| Helmut wrote:
> There is one interesting point I would like to be sure in.
> When performing decRef to an object, which reference count is 0, nothing
> happens. Is this correct ?
Correct.
> I know, this situation never should occur.
Correct.
> BTW, wouldn't it be useful to have a member function of object_reference
> which returns the value of the actual reference count (e.g. getRefCount()) ?
There is. The decRef() and incRef() APIs each return an unsigned long which
is the new value of the object's reference count after the operation has
been performed.
So, for example, to delete an object using decRef() rather than delete, you
could do ...
while (objPtr->decRef() > 0);
- Bob
|
| Hello,
I tried to do what is explained in .5 and it works quite well:
<< If the server calls 'delete dynObj_p', then the DCE runtime will know that
<< the server is deleting its reference to a remote object and issue a
<< decRef() back to the client. If the reference count is one on the client's
<< local object, it gets deleted.
I have a problem if the client has disappeared without performing the client
call: the delete tries to do the decRef () back to the client, and of course,
cannot do it as the client is no more there. That's fine and I can handle
the exception generated by the 'delete dynObj_p' in a TRY CATCH block. The
problem I have is that in this case, some memory (probably related to the
proxy object) is not freed.
Is this a normal behaviour? Is there something I can do to prevent this
memory leak?
Thank you in advance,
Pierre
PS:I am using DCE V2.0A with DIGITAL UNIX V4.0.
|