diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-11-01 19:22:15 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-11-01 19:23:12 +0100 |
commit | 8ac1bcfd3d9bd3a5ab89916f21d77c21499c7249 (patch) | |
tree | 36da83f9848602891b1de911bb3954620080f75c /platform | |
parent | b9dd095275c2dde27d1abc26efbcc010ebd1436b (diff) |
Fix init of VisualServerRaster
Contrarily to what #23434 assumed, this is not a memory leak,
the VisualServerRaster instance is passed as a parameter to
VisualServerWrapMT's constructor.
Fixes #23437.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/os_android.cpp | 5 | ||||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 6 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 5 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 4 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 6 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 18 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 5 |
7 files changed, 11 insertions, 38 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index abbd9c9aa7..96ff226402 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -182,15 +182,12 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int video_driver_index = p_video_driver; + visual_server = memnew(VisualServerRaster); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, false)); - } else { - visual_server = memnew(VisualServerRaster); } visual_server->init(); - // visual_server->cursor_set_visible(false, 0); AudioDriverManager::initialize(p_audio_driver); diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index a4a32c939c..f9f12af817 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -117,12 +117,10 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p #endif - // FIXME: Reimplement threaded rendering? Or remove? + visual_server = memnew(VisualServerRaster); + // FIXME: Reimplement threaded rendering if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, false)); - } else { - visual_server = memnew(VisualServerRaster); } ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE); diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index d0934d8e9d..e996a5905b 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -107,11 +107,10 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); - // FIXME: Reimplement threaded rendering? Or remove? + visual_server = memnew(VisualServerRaster); + // FIXME: Reimplement threaded rendering if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { visual_server = memnew(VisualServerWrapMT(visual_server, false)); - } else { - visual_server = memnew(VisualServerRaster); } visual_server->init(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index cbdec92b90..5b60e1b633 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1383,11 +1383,9 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a video_driver_index = p_video_driver; + visual_server = memnew(VisualServerRaster); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); - } else { - visual_server = memnew(VisualServerRaster); } visual_server->init(); diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 5de8f6539f..2209ecb20e 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -294,12 +294,10 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au set_video_mode(vm); - // FIXME: Reimplement threaded rendering? Or remove? + visual_server = memnew(VisualServerRaster); + // FIXME: Reimplement threaded rendering if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, false)); - } else { - visual_server = memnew(VisualServerRaster); } visual_server->init(); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 7a543445b6..f8705c4bff 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1332,27 +1332,11 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int gl_context->set_use_vsync(video_mode.use_vsync); #endif + visual_server = memnew(VisualServerRaster); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); - } else { - visual_server = memnew(VisualServerRaster); } - /* - DEVMODE dmScreenSettings; // Device Mode - memset(&dmScreenSettings,0,sizeof(dmScreenSettings)); // Makes Sure Memory's Cleared - dmScreenSettings.dmSize=sizeof(dmScreenSettings); // Size Of The Devmode Structure - dmScreenSettings.dmPelsWidth = width; // Selected Screen Width - dmScreenSettings.dmPelsHeight = height; // Selected Screen Height - dmScreenSettings.dmBitsPerPel = bits; // Selected Bits Per Pixel - dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; - if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL) - - - - - */ visual_server->init(); input = memnew(InputDefault); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 4fa34b1f2b..8ba5833796 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -343,12 +343,11 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a #endif + visual_server = memnew(VisualServerRaster); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); - } else { - visual_server = memnew(VisualServerRaster); } + if (current_videomode.maximized) { current_videomode.maximized = false; set_window_maximized(true); |