on 1/27/06 10:00 AM, Dave Addey at listmail1 at dsl dot pipex dot com wrote:
> static void FileLocationSetter (REALobject instance, long param, REALstring
> value)
> {
> ClassData (RB_SongLoader, instance, RB_SongLoaderData, me);
> SongLoaderDataRef myParameters = (SongLoaderDataRef)me->myParametersRef;
> myParameters->FileLocation = value;
> }
This looks suspicious. You're keeping a reference to the passed in string
without locking it. I wonder if the memory management on Windows is biting
you.
The code should look like:
static void FileLocationSetter (REALobject instance, long param, REALstring
value)
{
ClassData (RB_SongLoader, instance, RB_SongLoaderData, me);
SongLoaderDataRef myParameters =(SongLoaderDataRef)me->myParametersRef;
if ( myParameters->FileLocation )
REALUnlockString( myParameters->FileLocation ) ;
REALLockString( value ) ;
myParameters->FileLocation = value;
}
Of course you would have to change the destructor to have the same unlock
code.
Chris
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|