From b8efa6372b8b55cb444a0acb001fe339cf53c92c Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 25 Jun 2013 05:37:44 -0300 Subject: [PATCH] oops --- src/modules/image/wrap_ImageData.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/image/wrap_ImageData.cpp b/src/modules/image/wrap_ImageData.cpp index c32c4f83b..476658060 100644 --- a/src/modules/image/wrap_ImageData.cpp +++ b/src/modules/image/wrap_ImageData.cpp @@ -195,13 +195,16 @@ int w_ImageData_mapPixel(lua_State *L) ImageData *t = luax_checkimagedata(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); + love::thread::Mutex *mutex = t->getMutex(); + lua_pushcfunction(L, w_ImageData_mapPixelUnsafe); lua_pushvalue(L, 1); lua_pushvalue(L, 2); // Manually lock this ImageData's mutex during the entire mapPixel. - love::thread::Lock lock(t->getMutex()); + mutex->lock(); int ret = lua_pcall(L, 2, 0, 0); + mutex->unlock(); if (ret != 0) return lua_error(L);