aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2022-12-10 10:49:09 +1000
committerGitHub <noreply@github.com>2022-12-10 10:49:09 +1000
commit60eba26f9bb2d2d3d916790de71ff368c994912c (patch)
tree172273732c736a53128b08d3d4cbe21698fb6b97
parent26f329a23eec4d612e3723204d1c34a2c050b4a4 (diff)
parentc23e8edac4c5a97d34755eca83e313fefabdc6ae (diff)
Merge pull request #22228 from enen92/get_glcontext_macos
[Macos][NativeWindowing] Get GL context on main thread
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index fe93e5caa8..85dd4b764a 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -1184,11 +1184,13 @@ void CWinSystemOSX::WindowChangedScreen()
CGLContextObj CWinSystemOSX::GetCGLContextObj()
{
- CGLContextObj cglcontex = nullptr;
+ __block CGLContextObj cglcontex = nullptr;
if (m_appWindow)
{
- OSXGLView* contentView = m_appWindow.contentView;
- cglcontex = contentView.getGLContext.CGLContextObj;
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ OSXGLView* contentView = m_appWindow.contentView;
+ cglcontex = contentView.getGLContext.CGLContextObj;
+ });
}
return cglcontex;