version 1.2, 2009/12/15 11:39:34
|
version 1.3, 2009/12/21 13:06:36
|
|
|
if ( 1 < inst.hdr->refCount.get() ) | if ( 1 < inst.hdr->refCount.get() ) |
{ | { |
SCMBInstance_Main * oldRef = inst.hdr; | SCMBInstance_Main * oldRef = inst.hdr; |
|
SCMBMgmt_Header* oldMgmt = inst.mem; |
|
|
_clone(); | _clone(); |
if (oldRef->refCount.decAndTestIfZero()) | if (oldRef->refCount.decAndTestIfZero()) |
{ | { |
// All external references has to be destroyed. | // All external references has to be destroyed. |
_destroyExternalReferencesInternal((SCMBMgmt_Header*)oldRef); |
_destroyExternalReferencesInternal(oldMgmt); |
// The class has also be dereferenced. | // The class has also be dereferenced. |
delete oldRef->theClass.ptr; | delete oldRef->theClass.ptr; |
free((void*)oldRef); | free((void*)oldRef); |