Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-07

TQtCaret mem leak

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Seem that nobody is freeing GlobalCaret variable from QtCaret unit, so it produces mem leak.
So , should we create it with Application parameter as Owner instead of nil, or call some destroy on app termination ?
I've just setted up Application as Owner, leak is gone .... any ?

Vincent Snijders
to Unknown author
Show quoted text 7 lines
Seem that nobody is freeing GlobalCaret variable from QtCaret unit, so it produces mem leak. So , should we create it with Application parameter as Owner instead of nil, or call some destroy on app termination ? I've just setted up Application as Owner, leak is gone .... any ?

My first idea is in TQTWidgetSet.Destroy or TQTWidgetSet.AppTerminate.

Who creates the GlobalCaret?

Vincent

Unknown author
to Vincent Snijders

Quoting Vincent Snijders :

Show quoted text 12 lines
schreef: > Seem that nobody is freeing GlobalCaret variable from QtCaret unit, so > it produces mem leak. > So , should we create it with Application parameter as Owner instead > of nil, or call some destroy on app termination ? > I've just setted up Application as Owner, leak is gone .... > any ? > My first idea is in TQTWidgetSet.Destroy or TQTWidgetSet.AppTerminate. Who creates the GlobalCaret?

winapi eg. ShowCaret(). It's created only once during application lifetime (if any control asks about caret), and it's never deleted.

Vincent Snijders
to Unknown author
Show quoted text 11 lines
Quoting Vincent Snijders : > schreef: >> Seem that nobody is freeing GlobalCaret variable from QtCaret unit, so >> it produces mem leak. >> So , should we create it with Application parameter as Owner instead >> of nil, or call some destroy on app termination ? >> I've just setted up Application as Owner, leak is gone .... >> any ? >> > My first idea is in TQTWidgetSet.Destroy or TQTWidgetSet.AppTerminate.

Or let the WidgetSet be the owner, instead of the application.

Show quoted text 5 lines
> > Who creates the GlobalCaret? winapi eg. ShowCaret(). It's created only once during application lifetime (if any control asks about caret), and it's never deleted.

Vincent

Paul Ishenin
to Vincent Snijders
Vincent Snijders wrote 14 lines
schreef: > Quoting Vincent Snijders : > >> schreef: >>> Seem that nobody is freeing GlobalCaret variable from QtCaret unit, so >>> it produces mem leak. >>> So , should we create it with Application parameter as Owner instead >>> of nil, or call some destroy on app termination ? >>> I've just setted up Application as Owner, leak is gone .... >>> any ? >>> >> My first idea is in TQTWidgetSet.Destroy or TQTWidgetSet.AppTerminate. Or let the WidgetSet be the owner, instead of the application.

More usual way (used in other widgetsets) is to use TQtWidgetset.Destroy, so I've done it that way.

It will be more comfortable for other devels if things are done in one way in most widgetsets.

Best regards,
Paul Ishenin.