Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-105

libmongoclient should not link db/commands.cpp

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      All

      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

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: