From d4cf9db6388acb67a019631d412811d399799a1d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 2 Jul 2014 21:05:46 -0700 Subject: [PATCH] Remove unnecessary context initialization code There was no need to call the context free function in the initialization function, and it's safer to just initialize the memory to 0 before using (which also negates the need for da_init) --- libobs/obs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libobs/obs.c b/libobs/obs.c index 811fdef99..4c2735d20 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -1188,10 +1188,9 @@ static inline bool obs_context_data_init_wrap( const char *name) { assert(context); + memset(context, 0, sizeof(*context)); pthread_mutex_init_value(&context->rename_cache_mutex); - obs_context_data_free(context); - if (pthread_mutex_init(&context->rename_cache_mutex, NULL) < 0) return false; @@ -1205,8 +1204,6 @@ static inline bool obs_context_data_init_wrap( context->name = dup_name(name); context->settings = obs_data_newref(settings); - - da_init(context->rename_cache); return true; } -- GitLab