mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Multi-line text input at Test Window has memory leak when we use ctrl-c, ctrl-v at the window #714
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#714
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Multi-line text input at Test Window has memory leak when we use ctrl-c, ctrl-v at the window
you can detect it you just copy the window text and past at the same text window.
Are you talking about an actual leak or a growing buffer? Can you show samples of your detection?
I am now busy at a project so can not see it deeply.
but what I saw is that when I see a memory leak the Pasted memory is not freed
Detected memory leaks!
Dumping objects ->
{102535} normal block at 0x0F487ED0, 322 bytes long.
Data: </* The Pentium > 2F 2A 0A 20 54 68 65 20 50 65 6E 74 69 75 6D 20
Object dump complete.
and it is not a growing buffer.
I am using VS 2015 and memory leak check option is like this
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_EVERY_1024_DF);
I cannot seem to repro. Did you call ImGui::Shutdown() ?
All the memory held by the text edit state is carried in ImVector<> which has a destructor.
void ImGui_ImplDX11_Shutdown()
{
ImGui_ImplDX11_InvalidateDeviceObjects();
ImGui::Shutdown();
g_pd3dDevice = NULL;
g_pd3dDeviceContext = NULL;
g_hWnd = (HWND)0;
}
Detected memory leaks!
Dumping objects ->
{90594} normal block at 0x0F085100, 349 bytes long.
Data: <* The Pentium F> 2A 0A 20 54 68 65 20 50 65 6E 74 69 75 6D 20 46
Object dump complete.
yes i checked it again.
and I will try to check it out too.
Interesting/weird, I get it with the DX11 sample but not with the OpenGL one.
Oh I see, it isn't InputTextMultiline(), but the default clipboard helper for Windows:
There's a local buffer.
Fixed, thanks!
It was a one-time end of application leak so really not causing a problem in the long run, but obviously correct to fix.
Nice Job.
It is good to run now.