anuragiitg / nixysa

Automatically exported from code.google.com/p/nixysa
Apache License 2.0
0 stars 0 forks source link

Returned value is released too early in Synchronous callback #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Sample with a Synchronous CallBack which returns a string ( not an 
empty string, put something into)
2. Call this CallBack ( make the piece of C++ code that call this CallBack and 
expose it in IDL file)
3. From jscript, reguster the CallBacl and call it

What is the expected output? What do you see instead?
The expected result is to have the returned string from the callback
Instead, the returned string is an EmptyString

What version of the product are you using? On what operating system?
NIXYSA GLUE

Please provide any additional information below.

The python generated code releases the returned "result" variable and it is 
never assigned to the returned string (retval).

The generated function in file called NPPluginName_glue.cc :
std::wstring RunCallback(NPP npp, NPObject *npobject, bool async, const 
std::wstring& arg0) releases the "result" variable immediately after calling 
"NPN_InvokeDefault" and the other variable (std::wstring retval;) declared a 
few line after is never assigned to "result".

Original issue reported on code.google.com by jamal.Ba...@gmail.com on 1 Oct 2012 at 10:26