Solved Memory Leak in Qt 4.10.0
-
@ndiwan said in Memory Leak in Qt 4.10.0:
m_SelectedPath.addRect(0,0, getRectWidth()+10, getRectHeight()+10);
Do you ever remove rects from m_SelectedPath?
-
No. How to remove rect from QPainterPath ?
Thanks
-
@ndiwan Why do you actually add a rect each time paintEvent is called?
-
@ndiwan should actually not be necessary ,
m_SelectedPath
is, despite its name, a local (scoped) variable:void CSkateRetarder::paintEvent(QPaintEvent * ) { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); QPainterPath m_SelectedPath = QPainterPath(); m_SelectedPath.addRect(0,0, getRectWidth()+10, getRectHeight()+10); ...
so it should get cleaned up when the function returns
-
@J-Hilk Ah, you're right, didn't notice this.
-
I am drawing a rectangular widget. That's why addign rectangle. Did you still see any memory leakage related issue in paintEvent ?
Thanks
-
@ndiwan said in Memory Leak in Qt 4.10.0:
Did you still see any memory leakage related issue in paintEvent ?
No
Did you run Valgrind as suggested to find memory leaks? -
Sorry, But I am not sure how to use that in Window Qt. I know ho to use valgrind in Linux
Actually my application runs with a login dialog. Do I need to provided user id and passoword in arguments here ?
Also kit drop down is diable.Thanks
-
@ndiwan said in Memory Leak in Qt 4.10.0:
Do I need to provided user id and passoword in arguments here ?
No
"Also kit drop down is diable" - what do you mean?
-
Kit dropdown is disable.
Thansks
-
@ndiwan said in Memory Leak in Qt 4.10.0:
Kit dropdown is disable
This is the same what I asked about. Can you please explain what dropdown you mean? Maybe a screen-shot?
-
In the above screenshot Kit combo dropdown is disable. If I click manage , I can see this:
-
@ndiwan Do you have Valgrind? Check in Analyzer/Valgrind. You need to set the path to Valgrind executable.
-
@jsulm Since when does valgrind run on windows?
-
@Christian-Ehrlicher Ah, Windows. Well, since never :-)
-
So How I can check memory leakage in Qt Creator running on Windows 10 ?
Thanks
-
@Christian-Ehrlicher said in Memory Leak in Qt 4.10.0:
Since when does valgrind run on windows?
I am the person who originally replied to @ndiwan 's "Could you please help me with how I can detect memory leak." with "Use
valgrind
to detect memory leakages."I read the question carefully and nowhere did it mention using Windows. One of my pet bug-bears is if questioners cannot tell you what OS they are on for a question of this kind, why should I guess they are under Windows? Other OS people tell you what they are on, why do Windows users think people ought know they are on Windows...?
-
@ndiwan said in Memory Leak in Qt 4.10.0:
So How I can check memory leakage in Qt Creator running on Windows 10 ?
I would imagine it would depend on what compiler you have chosen to use, which we don't know....
-
@JonB According to Kits it's MinGW
-
@JonB said in Memory Leak in Qt 4.10.0:
why do Windows users think people ought know they are on Windows...?
I don't know.
And yes - my answer would also be - use valgrind or any other proper leak checker tool and how to you know that there is a memleak at all?