Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 4258

Need advices

$
0
0

Hello,

I’m still scratching my head about how to use lock/unlock object especially in a plugin. That’s why I’m wondering if this is the best way to do it. Thanks for your insight.

static void RaiseFannException(char const *msg)
{
    REALobject exc = REALnewInstanceOfClass(&xFANNException_Definition);
    if (exc != NULL) {
        REALstring errStr = REALBuildString(msg, strlen(msg) + 1, kREALTextEncodingUTF8);
        if (errStr != NULL) {
            REALSetPropValueString(exc, "Message", errStr);
            REALUnlockString(errStr);
            REALRaiseException(exc);
            REALUnlockObject(exc); // Before or after raising the exception ??
        }
    }
}

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4258

Trending Articles