New topic: 

Do I Need To Call REALLockObject?

<http://forums.realsoftware.com/viewtopic.php?t=24872>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       danamac           Post subject: Do I Need To Call 
REALLockObject?Posted: Mon Oct 20, 2008 8:44 am                        
Joined: Wed May 10, 2006 5:16 pm
Posts: 17
Location: Lawrenceville, NJ              I have a plugin class that creates 
objects of another class by calling REALnewInstance. The plugin keeps a list of 
these objects:
  REALobject myObjsREAL[ 16 ];

myObjsREAL[0] = REALnewInstance( "CThing" );


The RB application makes a call into the plugin to get one of these objects 
from the list:
  Dim thing As CThing
  thing = GetFirstThing()
  

The plugin implements GetFirstThing as:
static REALObject
GetFirstThing( REALobject obj )
{
 return( myObjsREAL[0] );
}

static REALmethodDefinition _methName[] = {
 { (REALproc)GetFirstThing, REALnoImplementation, "GetFirstThing() As CThing" } 
};


When the plugin creates the object,  REALnewInstance returns a locked object 
(right?)

Does the plugin need to call REALLockObject in GetFirstThing before it returns 
the object to RB?

I was thinking "no" because the RB code does not call "thing = new CThing", 
just thing = GetFirstThing().
Since the RB code does not create the object it would just use it as is. Or 
else lock it and unlock it. 

The RB code wouldn't assume that it came locked and just unlock it after it was 
done would it?

REALBasic 2008r4.1 Xcode 2.4.1 OS X 10.4.11   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to