diff --git a/3rdparty/ocornut-imgui/imgui_wm.cpp b/3rdparty/ocornut-imgui/imgui_wm.cpp index 672e1d57..f0dde477 100644 --- a/3rdparty/ocornut-imgui/imgui_wm.cpp +++ b/3rdparty/ocornut-imgui/imgui_wm.cpp @@ -17,7 +17,7 @@ #define IMGUI_NEW(type) new (ImGui::MemAlloc(sizeof(type) ) ) type #define IMGUI_DELETE(type, obj) reinterpret_cast(obj)->~type(), ImGui::MemFree(obj) -#define IMGUI_DELETE_NULL(type, obj) do { if (NULL != obj) { IMGUI_DELETE(type, obj); obj = NULL; } } while (0) +#define IMGUI_DELETE_NULL(type, obj) for (;;) { if (NULL != obj) { IMGUI_DELETE(type, obj); obj = NULL; } break; } namespace ImGuiWM { diff --git a/examples/common/imgui/ocornut_imgui.cpp b/examples/common/imgui/ocornut_imgui.cpp index 44028573..8d1e824b 100644 --- a/examples/common/imgui/ocornut_imgui.cpp +++ b/examples/common/imgui/ocornut_imgui.cpp @@ -128,7 +128,7 @@ public: protected: virtual ImGuiWM::PlatformWindow* CreatePlatformWindow(bool _main, ImGuiWM::PlatformWindow* _parent, bool _isDragWindow) BX_OVERRIDE { - PlatformWindow* window = new PlatformWindow(_main, _isDragWindow); + PlatformWindow* window = new (ImGui::MemAlloc(sizeof(PlatformWindow) ) ) PlatformWindow(_main, _isDragWindow); window->Init(_parent); return static_cast(window); }