From 2ec8cb802b85354019dfb6ffc4172e90dbd582ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 5 Oct 2015 11:36:14 -0700 Subject: [PATCH] Cleanup. --- 3rdparty/ocornut-imgui/imgui_wm.cpp | 2 +- examples/common/imgui/ocornut_imgui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); }