(svn r15330) -Fix [FS#2597]: leaking of Squirrel when using circular references (by enabling the GC).

This commit is contained in:
rubidium
2009-02-03 22:42:42 +00:00
parent 101f55e65c
commit 1c30c8c801
10 changed files with 44 additions and 17 deletions

View File

@@ -175,6 +175,11 @@ bool Squirrel::Resume(int suspend)
return this->vm->_suspended != 0;
}
void Squirrel::CollectGarbage()
{
sq_collectgarbage(this->vm);
}
bool Squirrel::CallMethod(HSQOBJECT instance, const char *method_name, HSQOBJECT *ret, int suspend)
{
/* Store the stack-location for the return value. We need to

View File

@@ -101,6 +101,11 @@ public:
*/
bool Resume(int suspend = -1);
/**
* Tell the VM to do a garbage collection run.
*/
void CollectGarbage();
void InsertResult(bool result);
void InsertResult(int result);