소스 검색

libobs: Check effect mutex exists before destroying it

Fixes a crash if graphics system didn't finish intializing.
Richard Stanway 10 년 전
부모
커밋
c2c47b1169
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      libobs/graphics/graphics.c

+ 2 - 1
libobs/graphics/graphics.c

@@ -213,7 +213,8 @@ void gs_destroy(graphics_t *graphics)
 	}
 	}
 
 
 	pthread_mutex_destroy(&graphics->mutex);
 	pthread_mutex_destroy(&graphics->mutex);
-	pthread_mutex_destroy(&graphics->effect_mutex);
+	if (graphics->effect_mutex)
+		pthread_mutex_destroy(&graphics->effect_mutex);
 	da_free(graphics->matrix_stack);
 	da_free(graphics->matrix_stack);
 	da_free(graphics->viewport_stack);
 	da_free(graphics->viewport_stack);
 	da_free(graphics->blend_state_stack);
 	da_free(graphics->blend_state_stack);