|
@@ -26,7 +26,6 @@
|
|
#include "Object.h"
|
|
#include "Object.h"
|
|
#include "Reference.h"
|
|
#include "Reference.h"
|
|
#include "StringMap.h"
|
|
#include "StringMap.h"
|
|
-#include <thread/threads.h>
|
|
|
|
|
|
|
|
// C++
|
|
// C++
|
|
#include <algorithm>
|
|
#include <algorithm>
|
|
@@ -36,22 +35,15 @@
|
|
namespace love
|
|
namespace love
|
|
{
|
|
{
|
|
|
|
|
|
-static thread::Mutex *gcmutex = nullptr;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Called when an object is collected. The object is released
|
|
* Called when an object is collected. The object is released
|
|
* once in this function, possibly deleting it.
|
|
* once in this function, possibly deleting it.
|
|
**/
|
|
**/
|
|
static int w__gc(lua_State *L)
|
|
static int w__gc(lua_State *L)
|
|
{
|
|
{
|
|
- if (!gcmutex)
|
|
|
|
- gcmutex = thread::newMutex();
|
|
|
|
-
|
|
|
|
Proxy *p = (Proxy *) lua_touserdata(L, 1);
|
|
Proxy *p = (Proxy *) lua_touserdata(L, 1);
|
|
Object *object = (Object *) p->data;
|
|
Object *object = (Object *) p->data;
|
|
|
|
|
|
- thread::Lock lock(gcmutex);
|
|
|
|
-
|
|
|
|
object->release();
|
|
object->release();
|
|
|
|
|
|
return 0;
|
|
return 0;
|