Question under references
Hello.
At work above the project with use of your script, we had following situation. Details are lower.
By a call of function from AngelScript, registered with the signature of type:
void Fn (RefClassName @obj);
System AngelScript for obj does AddRef.
The citation:
--------------
3. The superfluous amount of calls AddRef and Release can be reduced if to have the additional information on links between two and more cells of memory.
...
The typical situation to which the rule about the additional information is applicable, arises by transfer of indexes of interfaces to functions as to parameters [in]:
• S1. When by a call of function or a method the nonzero interface index is transferred through [in] parameter, call AddRef and Release, are not required, as time of life of a time variable in a stack is a strict subset of time of life of the expression used for initialization of formal argument.
(Donald Boks, “ Essence of technology the COM ”)
----------------------
As a matter of fact, the argument of function obj - is argument such as in. Apparently from the citation, it is possible to apply various methods of a call of function with the entrance nonzero index of type [in.] AngelScript by such call does AddRef. And at us, unfortunately, is not present (accordingly, Release () we too we do not do{we make}). To correct at us all methods and functions accepting nonzero the index, will rather hardly, probably demand a spelling very much a plenty of wrappers.
Perhaps it is possible what to correct that in the image at level AngelScript? Advise the decision of the given problem?
Use of the signature of type ∈ in our case as it is not comprehensible because the copy of transmitted object is created, that frequently breaks logic of work of the program.
I'm having a bit of difficulty understanding what you're writing. But I believe you're asking if there is some way to avoid using wrappers in order to take care of the AngelScript object handles passed in parameters to application functions that do not properly call Release() on them. Am I right?
The answer is yes. By using the AngelScript autohandles, @+, the script engine will automatically release any handles passed to application functions, once the function returns. This will alleviate the need for wrappers in most cases (at the cost of a slightly increased overhead in function calls).
Read the following page that I wrote about object handles for more information: Object handles on the AngelScript wiki
Regards,
Andreas
The answer is yes. By using the AngelScript autohandles, @+, the script engine will automatically release any handles passed to application functions, once the function returns. This will alleviate the need for wrappers in most cases (at the cost of a slightly increased overhead in function calls).
Read the following page that I wrote about object handles for more information: Object handles on the AngelScript wiki
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Hello.
Thank it is valid, that is necessary. Thank big.
Thank it is valid, that is necessary. Thank big.
Quote: Original post by WitchLord
I'm having a bit of difficulty understanding what you're writing. But I believe you're asking if there is some way to avoid using wrappers in order to take care of the AngelScript object handles passed in parameters to application functions that do not properly call Release() on them. Am I right?
The answer is yes. By using the AngelScript autohandles, @+, the script engine will automatically release any handles passed to application functions, once the function returns. This will alleviate the need for wrappers in most cases (at the cost of a slightly increased overhead in function calls).
Read the following page that I wrote about object handles for more information: Object handles on the AngelScript wiki
Regards,
Andreas
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement