{"action":"created","issue":{"url":"https://api.github.com/repos/ocornut/imgui/issues/538","repository_url":"https://api.github.com/repos/ocornut/imgui","labels_url":"https://api.github.com/repos/ocornut/imgui/issues/538/labels{/name}","comments_url":"https://api.github.com/repos/ocornut/imgui/issues/538/comments","events_url":"https://api.github.com/repos/ocornut/imgui/issues/538/events","html_url":"https://github.com/ocornut/imgui/issues/538","id":137056325,"number":538,"title":"Memory allocation/dealloc problem in imgui_demo.cpp","user":{"login":"septag","id":5081921,"avatar_url":"https://avatars.githubusercontent.com/u/5081921?v=3","gravatar_id":"","url":"https://api.github.com/users/septag","html_url":"https://github.com/septag","followers_url":"https://api.github.com/users/septag/followers","following_url":"https://api.github.com/users/septag/following{/other_user}","gists_url":"https://api.github.com/users/septag/gists{/gist_id}","starred_url":"https://api.github.com/users/septag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/septag/subscriptions","organizations_url":"https://api.github.com/users/septag/orgs","repos_url":"https://api.github.com/users/septag/repos","events_url":"https://api.github.com/users/septag/events{/privacy}","received_events_url":"https://api.github.com/users/septag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-28T14:01:27Z","updated_at":"2016-02-29T11:40:25Z","closed_at":null,"body":"I think I've submitted this before. Although it's a minor thing, but it raises problems when using custom allcoators and _ShowTestWindow()_ function.\r\n\r\nThere is a static ImVector decleration in _imgui_demo.cpp@716_ That causes the ImVector destructor to crash on program exit.\r\nIs there any workarounds for this, instead of using static declerations ? \r\n\r\nthanks\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ocornut/imgui/issues/comments/190171204","html_url":"https://github.com/ocornut/imgui/issues/538#issuecomment-190171204","issue_url":"https://api.github.com/repos/ocornut/imgui/issues/538","id":190171204,"user":{"login":"septag","id":5081921,"avatar_url":"https://avatars.githubusercontent.com/u/5081921?v=3","gravatar_id":"","url":"https://api.github.com/users/septag","html_url":"https://github.com/septag","followers_url":"https://api.github.com/users/septag/followers","following_url":"https://api.github.com/users/septag/following{/other_user}","gists_url":"https://api.github.com/users/septag/gists{/gist_id}","starred_url":"https://api.github.com/users/septag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/septag/subscriptions","organizations_url":"https://api.github.com/users/septag/orgs","repos_url":"https://api.github.com/users/septag/repos","events_url":"https://api.github.com/users/septag/events{/privacy}","received_events_url":"https://api.github.com/users/septag/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T11:40:25Z","updated_at":"2016-02-29T11:40:25Z","body":"You can reproduce the bug by :\r\n- Override the memory allocator on init\r\n- Call ShowTestWindow after each NewFrame\r\n- Open the \"Graph Widgets\" panel\r\n- Close the app, call ```ImGui::Shutdown()``` then destroy the overrided allocator and exit the program\r\n\r\nThe program will crash because the custom allocator is destroyed, after that, the ```static ImVector<float> values;``` dtor is called, which calls the ```ImGui::MemFree(Data);``` that points to corrupt data.\r\n\r\n\r\n\r\n"}}