diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
commit | 3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253 (patch) | |
tree | 41f234c33e1e04015ef92a6b94212d9c7e97ad72 /contrib/dom/scripts/CodeGeneratorArabicaJSC.pm | |
parent | 720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da (diff) | |
download | uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.zip uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.gz uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.bz2 |
Bug fixes and version bump
- New calendar invoker
- Fixed memory leaks with JavaScriptCore
- Compiles on windows again
- Beautified source code indentation
Diffstat (limited to 'contrib/dom/scripts/CodeGeneratorArabicaJSC.pm')
-rw-r--r-- | contrib/dom/scripts/CodeGeneratorArabicaJSC.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm b/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm index 2de92a9..cc8debb 100644 --- a/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm +++ b/contrib/dom/scripts/CodeGeneratorArabicaJSC.pm @@ -349,8 +349,11 @@ END push(@implContent, "\n return JSValueMakeUndefined(ctx);"); } push(@implContent, <<END); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->${wrapperGetter}.c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; END } elsif($JSCType eq "Number") { push(@implContent, "\n return JSValueMakeNumber(ctx, privData->nativeObj->${wrapperGetter});\n"); @@ -387,7 +390,9 @@ END if ($JSCType eq "String") { push(@implContent, "\n JSStringRef jscString = JSStringCreateWithUTF8CString(" . $constant->value . ");". - "\n return JSValueMakeString(ctx, jscString);\n"); + "\n JSValueRef retVal = JSValueMakeString(ctx, jscString);". + "\n JSStringRelease(jscString);". + "\n return retVal;\n"); } elsif($JSCType eq "Number") { push(@implContent, "\n return JSValueMakeNumber(ctx, " . $constant->value . ");\n"); } elsif($JSCType eq "Boolean") { @@ -633,7 +638,8 @@ sub NativeToHandle return ("\n JSValueRef ${paramName} = JSValueMakeUndefined(ctx);") if ($nativeType eq "void"); return ( "\n JSStringRef jscString = JSStringCreateWithUTF8CString(${nativeName}.c_str());". - "\n JSValueRef ${paramName} = JSValueMakeString(ctx, jscString);" + "\n JSValueRef ${paramName} = JSValueMakeString(ctx, jscString);". + "\n JSStringRelease(jscString);" ) if ($nativeType eq "std::string"); die($nativeType); |