dirmonitor: added missing mutex initialization (#1150)
This commit is contained in:
parent
0fc793d1ae
commit
48c800cde7
|
@ -63,6 +63,7 @@ static int f_dirmonitor_new(lua_State* L) {
|
|||
struct dirmonitor* monitor = lua_newuserdata(L, sizeof(struct dirmonitor));
|
||||
luaL_setmetatable(L, API_TYPE_DIRMONITOR);
|
||||
memset(monitor, 0, sizeof(struct dirmonitor));
|
||||
monitor->mutex = SDL_CreateMutex();
|
||||
monitor->internal = init_dirmonitor();
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ struct dirmonitor_internal* init_dirmonitor() {
|
|||
monitor->stream = NULL;
|
||||
monitor->changes = NULL;
|
||||
monitor->count = 0;
|
||||
monitor->lock = NULL;
|
||||
|
||||
return monitor;
|
||||
}
|
||||
|
@ -136,6 +137,8 @@ int translate_changes_dirmonitor(
|
|||
int add_dirmonitor(struct dirmonitor_internal* monitor, const char* path) {
|
||||
stop_monitor_stream(monitor);
|
||||
|
||||
monitor->lock = SDL_CreateMutex();
|
||||
|
||||
FSEventStreamContext context = {
|
||||
.info = monitor,
|
||||
.retain = NULL,
|
||||
|
|
Loading…
Reference in New Issue