diff options
| author | 2022-03-08 12:36:57 -0800 | |
|---|---|---|
| committer | 2022-03-08 12:36:57 -0800 | |
| commit | f2743b41b0f8f82bcfe678cf735819ea987b62b4 (patch) | |
| tree | f5cd00237eda3d4ea49a434e8f01f2a912ded9ce /src/core/frontend/emu_window.h | |
| parent | Merge pull request #7989 from degasus/maxwell_LUT3 (diff) | |
| parent | video_core: Cancel Scoped's exit call on GPU failure (diff) | |
| download | yuzu-f2743b41b0f8f82bcfe678cf735819ea987b62b4.tar.gz yuzu-f2743b41b0f8f82bcfe678cf735819ea987b62b4.tar.xz yuzu-f2743b41b0f8f82bcfe678cf735819ea987b62b4.zip | |
Merge pull request #7986 from lat9nq/vk-callback
core, video_core: Fix two crashes when failing to create the emulated GPU instance
Diffstat (limited to 'src/core/frontend/emu_window.h')
| -rw-r--r-- | src/core/frontend/emu_window.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index e413a520a..b3bffecb2 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h | |||
| @@ -42,11 +42,20 @@ public: | |||
| 42 | context.MakeCurrent(); | 42 | context.MakeCurrent(); |
| 43 | } | 43 | } |
| 44 | ~Scoped() { | 44 | ~Scoped() { |
| 45 | context.DoneCurrent(); | 45 | if (active) { |
| 46 | context.DoneCurrent(); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | /// In the event that context was destroyed before the Scoped is destroyed, this provides a | ||
| 51 | /// mechanism to prevent calling a destroyed object's method during the deconstructor | ||
| 52 | void Cancel() { | ||
| 53 | active = false; | ||
| 46 | } | 54 | } |
| 47 | 55 | ||
| 48 | private: | 56 | private: |
| 49 | GraphicsContext& context; | 57 | GraphicsContext& context; |
| 58 | bool active{true}; | ||
| 50 | }; | 59 | }; |
| 51 | 60 | ||
| 52 | /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value | 61 | /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value |