mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Merge pull request #2153 from tujinshu/master
win-capture: Fix rare crash when OpenGL programs exit with graphics-hook
This commit is contained in:
@@ -30,6 +30,7 @@ static struct func_hook wgl_swap_buffers;
|
||||
static struct func_hook wgl_delete_context;
|
||||
|
||||
static bool darkest_dungeon_fix = false;
|
||||
static bool functions_initialized = false;
|
||||
|
||||
struct gl_data {
|
||||
HDC hdc;
|
||||
@@ -724,7 +725,6 @@ static void gl_shmem_capture(void)
|
||||
|
||||
static void gl_capture(HDC hdc)
|
||||
{
|
||||
static bool functions_initialized = false;
|
||||
static bool critical_failure = false;
|
||||
|
||||
if (critical_failure) {
|
||||
@@ -828,7 +828,7 @@ static BOOL WINAPI hook_wgl_delete_context(HGLRC hrc)
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
if (capture_active()) {
|
||||
if (capture_active() && functions_initialized) {
|
||||
HDC last_hdc = jimglGetCurrentDC();
|
||||
HGLRC last_hrc = jimglGetCurrentContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user