[CXX-105] libmongoclient should not link db/commands.cpp Created: 21/Jun/10  Updated: 10/Apr/14  Resolved: 10/Mar/14

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 1
Labels: cxxmove, legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All



 Description   

libmongoclient links db/commands.o (via the coreDbFiles variable in SConstruct) into the client library. It does that only so it can define two new commands (connPoolSync and connPoolStats) in client/connpool.cpp. Since Command objects are held by raw pointer in a static map, these objects are never collected during fini processing for libmongoclient. As a result, client code that links libmongoclient will show (real) memory leaks when run under Purify or valgrind.

The two commands should be moved to db/commands.cpp, which can be done easily since the global 'pool' object on which they depend is exposed in the connpool.h header, and the db/commands.o file should be removed from the link list for libmongoclient



 Comments   
Comment by Andrew Morrow (Inactive) [ 10/Mar/14 ]

Very old ticket of mine, no longer accurate.

Generated at Wed Feb 07 21:58:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.