fix crash while dynamic call createSurface (#12829)

* fix crash while dynamic call createSurface

* Fix the application crash when returning from the background to the foreground
This commit is contained in:
bofeng-song
2022-09-22 10:57:12 +08:00
committed by GitHub
parent 5d577e39ff
commit 82cbdfb232
3 changed files with 6 additions and 4 deletions

View File

@@ -45,7 +45,9 @@ ISystemWindow *SystemWindowManager::createWindow(const ISystemWindowInfo &info)
if (!info.externalHandle || !isExternalHandleExist(info.externalHandle)) {
ISystemWindow *window = BasePlatform::getPlatform()->createNativeWindow(_nextWindowId, info.externalHandle);
if (window) {
window->createWindow(info.title.c_str(), info.x, info.y, info.width, info.height, info.flags);
if (!info.externalHandle) {
window->createWindow(info.title.c_str(), info.x, info.y, info.width, info.height, info.flags);
}
_windows[_nextWindowId] = std::shared_ptr<ISystemWindow>(window);
_nextWindowId++;
}