Sign in Join

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

Mailing lists / qt / 2007-07

DestroyGlobalCaret

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Vincent Snijders

Hi,

I DestroyGlobalCaret can be much simpler:

FreeAndNil(GlobalCaret);

I don't know if DestroyGlobalCaret is called from more than one place, but if it is used in only one place, I would remove the complete procedure.

Vincnet

Paul Ishenin
to Vincent Snijders
Vincent Snijders wrote 10 lines
Hi, I looked at r11564. procedure DestroyGlobalCaret can be much simpler: FreeAndNil(GlobalCaret); I don't know if DestroyGlobalCaret is called from more than one place, but if it is used in only one place, I would remove the complete procedure.

yes, it is used in only one place. Free free to do anything you want with it :)

And btw about later commit (by zeljan):

this condition is not needed:

  if GlobalCaret  nil then

before GlobalCaret.Free sice Free already check object for nil before call destructor.

Zeljan, I you were on irc channel our communications will be easier :)

Best regards,
Paul Ishenin.

Vincent Snijders
to Paul Ishenin
Paul Ishenin wrote 24 lines
Vincent Snijders wrote: > Hi, > > I looked at r11564. > > procedure DestroyGlobalCaret can be much simpler: > > FreeAndNil(GlobalCaret); > > I don't know if DestroyGlobalCaret is called from more than one place, but if it is > used in only one place, I would remove the complete procedure. yes, it is used in only one place. Free free to do anything you want with it :) And btw about later commit (by zeljan): this condition is not needed: if GlobalCaret nil then before GlobalCaret.Free sice Free already check object for nil before call destructor.

This is exactly, what I was talking about. Did I use the wrong revision number?

Vincent

zeljko
to Paul Ishenin: yes, it is used in only one place. Free free to do anything you want with it :) And btw…
Paul Ishenin wrote 24 lines
Vincent Snijders wrote: > Hi, > > I looked at r11564. > > procedure DestroyGlobalCaret can be much simpler: > > FreeAndNil(GlobalCaret); > > I don't know if DestroyGlobalCaret is called from more than one place, > but if it is used in only one place, I would remove the complete > procedure. yes, it is used in only one place. Free free to do anything you want with it :) And btw about later commit (by zeljan): this condition is not needed: if GlobalCaret nil then before GlobalCaret.Free sice Free already check object for nil before call destructor.

wow, in K3 this will produce AV (if I remember correctly)

Zeljan, I you were on irc channel our communications will be easier :)

yep, I'll try to do so, but I've told you that it's summertime here ;), I have to install some IRC app (didn't use IRC for years ...) ... what was the irc server & channel ?

Paul Ishenin
to zeljko

zeljko ?????:

Show quoted text 32 lines
On Wednesday 18 July 2007 08:53, Paul Ishenin wrote: > Vincent Snijders wrote: >> Hi, >> >> I looked at r11564. >> >> procedure DestroyGlobalCaret can be much simpler: >> >> FreeAndNil(GlobalCaret); >> >> I don't know if DestroyGlobalCaret is called from more than one place, >> but if it is used in only one place, I would remove the complete >> procedure. > yes, it is used in only one place. Free free to do anything you want > with it :) > > And btw about later commit (by zeljan): > > this condition is not needed: > > if GlobalCaret nil then > > before GlobalCaret.Free sice Free already check object for nil before > call destructor. wow, in K3 this will produce AV (if I remember correctly) > Zeljan, I you were on irc channel our communications will be easier :) yep, I'll try to do so, but I've told you that it's summertime here ;), I have to install some IRC app (didn't use IRC for years ...) ... what was the irc server & channel ?

irc.freenode.net port 6667
channel: lazarus-ide

My nick: Paul Ishenin
Vincent: fpcfan
Felipe: sekelsenmat (but he is occasional user there)

Best regards,
Paul Ishenin.