diff options
author | Dwight <dmerriman@gmail.com> | 2008-07-17 16:02:32 -0400 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2008-07-17 16:02:32 -0400 |
commit | 1c54c09a288834822dedd4b42fbc807f3c620240 (patch) | |
tree | eec1f7d4f40284339a83872225fe3272ad0ad412 | |
parent | c3adb4946fd99ff8a76fc1abb0fabbbae2254c80 (diff) | |
download | mongo-1c54c09a288834822dedd4b42fbc807f3c620240.tar.gz |
mem leak regression from bad git merge fixedr0.0.8_rc1
-rw-r--r-- | db/jsobj.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/db/jsobj.h b/db/jsobj.h index c3dc8b8e960..cfdff58f04c 100644 --- a/db/jsobj.h +++ b/db/jsobj.h @@ -170,7 +170,14 @@ class JSObj { friend class JSElemIter; class Details { public: - ~Details() { _objdata = 0; } + ~Details() { + // note refCount means two different things (thus the assert here) + assert(refCount <= 0); + if (owned()) { + free((void *)_objdata); + } + _objdata = 0; + } const char *_objdata; int _objsize; int refCount; // -1 == don't free |