Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

releasing squirrel objects on class destruction.

Last post 08-04-2009, 8:49 PM by mtlung. 1 replies.
Sort Posts: Previous Next
  •  06-04-2009, 5:52 AM 3296

    releasing squirrel objects on class destruction.

    Hi.

    I need to implement some specialized container class for squirrel but currently I stuck with this problem: I'm storing "strong" references to squirrel objects in my C++ implementation and I cant release them in my release hook because I dont have virtual machine pointer in it. Of course I can get HSQUIRRELVM in other ways but I am afraid that this will be not correct to do some operations with vm in release hook function. The other way is to store in my C++ code only weak references but duplicate them in squirrel builtin array (which will be adde to members of my class) but it is also triky solution.

    So I'm wonder is there good way to implement in c++ custom containers for squirrel objects without using squirrel arrays or tables?

    Thanks and sorry for my english.
  •  08-04-2009, 8:49 PM 3410 in reply to 3296

    Re: releasing squirrel objects on class destruction.

    I cannot understand what can go wrong if you store HSQUIRRELVM in your C++ class, as long as you can assure your C++ class destroy before the VM. Any concern?
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems