realbasic-plugins
[Top] [All Lists]

Re: Unlocking or not?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Unlocking or not?
From: Jonathan Johnson <jonj at realsoftware dot com>
Date: Wed, 27 Jun 2007 22:05:48 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <17644250-15DB-4A8C-8771-B4B9FCD84F9B at mac dot com> <460C193B-0731-4FA9-A8EF-DA93AB5D78FA at realsoftware dot com> <F1C9D799-D884-4DB4-BA1A-66DE21F66973 at mac dot com>
On Jun 27, 2007, at 9:32 PM, Alfred Van Hoek wrote:

>
>
> If we don't unlock we leak sometimes, and if we do unlock, we crash
> after a couple of times, because the destructor of the stored object
> was called. The crash occurs then when myDict.value(key) is called.

I would investigate the code immediately after adding the object to  
the dictionary to ensure that there isn't an extraneous unlock call  
around there. It is necessary to unlock on return, but I'm guessing  
there is some other location that you're calling it that isn't correct.

Sorry I can't give any more specific issues -- these are the hardest  
to debug. I'd suggest printing out each object address REALLock/ 
UnlockObject is called on, and seeing where the unbalanace lies.

HTH,
Jon
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>