Branimir Karadžić 10 years ago
parent
commit
2ec8cb802b
2 changed files with 2 additions and 2 deletions
  1. 1 1
      3rdparty/ocornut-imgui/imgui_wm.cpp
  2. 1 1
      examples/common/imgui/ocornut_imgui.cpp

+ 1 - 1
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<type*>(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
 {

+ 1 - 1
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<ImGuiWM::PlatformWindow*>(window);
 	}