On Jul 14, 2006, at 11:05 AM, Christian Schmitz wrote:

Boolean HasMask(REALpicture thePict)          // REALobject instance
{
     return (REALGetPictureMask(thePict, false) != NULL);
}

Guess why this leaks memory.

OK, thanks! It has been over 2 years since I last worked in C/C++... and I guess I just got used to REALbasic memory management. How is this instead:

Boolean HasMask(REALpicture thePict)            // REALobject instance
{
     REALpicture theMask = REALGetPictureMask(thePict, false);
     if(theMask != NULL)
     {  
          REALUnlockObject((REALobject)theMask);
          return true;
     } else {
          return false;
     }
}


_______________________________________________
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>

Reply via email to