On Sat, 27 Apr 2002 13:05:57 +0200 Xavier Nodet <[EMAIL PROTECTED]> wrote:

XN> Here I do not agree. The URLDetector is created only once, for the
XN> whole life of the program, as it is a static variable:
XN> 
XN>   String
XN>   strutil_findurl(String& str, String& url)
XN>   {
XN>      static URLDetector s_detector;
XN> 
XN> You can check that the constructor of URLDetector is called
XN> only once, even if you look at several messages.
XN> 
XN> So it is correct that there is a memory leak, but it is rather
XN> small (let's say 100 bytes, at most) and it will never increase
XN> (I mean that it does not grow with time).

 Doh, you're right, of course. Indeed, it's quite harmless so I take my
words back - sorry.

XN> Of course, we could deallocate the URLDetector at the end of
XN> strutil_findurl, but then we would need to recreate it each
XN> time. This would quite defeat the purpose of this code.

 Of course! No, we should definitely keep a single copy of it.

XN> I will try to write a destructor for URLDetector, in case it
XN> would be used for other purposes.

 This would still be nice as I wouldn't get the memory leak reports from
BoundsChecker then.

XN> VZ> P.S. BTW, I've added a trivial popup menu for the addresses in the viewer
XN> 
XN> Very nice, indeed.

 I do plan to have something better for "Add to address book" command.
Ideally I'd extract the tree from the ADB editor and show it in a dialog
here (like we already do with the folder tree -- well, in fact, the problem
with reusing the ADB tree was the driving force behind writing a decent
interface for the latter).

XN> Just a suggestion: I did not understand immediately that the
XN> first entry in the menu has no corresponding action. Is it
XN> possible to display it in another way (maybe in gray, as 'disabled')
XN> so that it is clear that it is just a piece of information.

 I think it would look really strange if it were disabled. This (putting
the menu title in bold) seems to be the standard Windows thing - i.e.
Explorer does it as well and I think that even if you're confused by it
once, it won't happen any more so it's not that bad (well, like that leak
above ;-)

 Thanks,
VZ


_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to