Skip to content

Commit

Permalink
check referencing removed source
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Nov 17, 2020
1 parent 549ad44 commit 42b3e46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(move-transition VERSION 2.0.1)
project(move-transition VERSION 2.0.2)
set(PROJECT_FULL_NAME "Move Transition")

set(move-transition_HEADERS
Expand Down
15 changes: 15 additions & 0 deletions move-source-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,14 @@ void move_source_source_media_ended(void *data, calldata_t *call_data)
UNUSED_PARAMETER(call_data);
}

void move_source_source_remove(void *data, calldata_t *call_data)
{
struct move_source_info *move_source = data;
obs_sceneitem_release(move_source->scene_item);
move_source->scene_item = NULL;
UNUSED_PARAMETER(call_data);
}

void move_source_update(void *data, obs_data_t *settings)
{
struct move_source_info *move_source = data;
Expand Down Expand Up @@ -656,6 +664,9 @@ void move_source_update(void *data, obs_data_t *settings)
signal_handler_disconnect(
sh, "media_ended",
move_source_source_media_ended, data);
signal_handler_disconnect(
sh, "remove", move_source_source_remove,
data);
}
obs_source_release(source);
}
Expand Down Expand Up @@ -686,6 +697,9 @@ void move_source_update(void *data, obs_data_t *settings)
signal_handler_connect(
sh, "media_ended",
move_source_source_media_ended, data);
signal_handler_connect(
sh, "remove", move_source_source_remove,
data);

move_source->source_name = bstrdup(source_name);
}
Expand Down Expand Up @@ -891,6 +905,7 @@ static void move_source_destroy(void *data)
}
}
obs_sceneitem_release(move_source->scene_item);
move_source->scene_item = NULL;
if (move_source->move_start_hotkey != OBS_INVALID_HOTKEY_ID)
obs_hotkey_unregister(move_source->move_start_hotkey);

Expand Down

0 comments on commit 42b3e46

Please sign in to comment.