Reputation: 228
I wrote a simple app with Qt 5.9.6, I ran that and wondered the used memory is growing. After tracing/debugging my application, I realized something about QPlainTextEdit !!!
The memory leak was for a qplaintextedit as a scratchpad in my app, but after every use of that, I used the clear() function to blank it for next use.
But the used memory by that scratchpad woudn't be released!
I opened a new project, containing a QPlainTextEdit & a QPushButton(to use clear() function).
9.7MiB
52MiB
9.7MiB
, but it was 52MiB
.I tried delete, static allocation, dynamic allocation..., many ways to manage that, but no different!
I found something in here, but it couldn't solve the problem.
Is this a bug in QPlainTextEdit or I'm doing wrong?
Upvotes: 0
Views: 243
Reputation: 49
I think it is Qt's defection.
You can run the Appliction.exe example of Qt , it also has the same problem.
Upvotes: 1