On Sat, 27 Apr 2002 01:31:23 +0200 (Romance Daylight Time) Vadim Zeitlin
<[EMAIL PROTECTED]> wrote:
VZ> Hi (Xavier),
VZ>
VZ> the KeywordDetectorCell allocated by KeywordDetector seem to be never
VZ> freed.
Correct.
VZ> I've tried to fix it but as I don't really understand what links are
VZ> between them I failed: deleting _brother results in infinite recursion. Not
VZ> deleting it resutls, of course, in a leak. Could you please look at it?
VZ> It's rather important as memory is leaked each time you view the message so
VZ> you risk to relatively quickly run out of it...
Here I do not agree. The URLDetector is created only once, for the
whole life of the program, as it is a static variable:
String
strutil_findurl(String& str, String& url)
{
static URLDetector s_detector;
You can check that the constructor of URLDetector is called
only once, even if you look at several messages.
So it is correct that there is a memory leak, but it is rather
small (let's say 100 bytes, at most) and it will never increase
(I mean that it does not grow with time).
Of course, we could deallocate the URLDetector at the end of
strutil_findurl, but then we would need to recreate it each
time. This would quite defeat the purpose of this code.
Do you really think that those few bytes represent a problem ?
Or did I miss some other case ?
I will try to write a destructor for URLDetector, in case it
would be used for other purposes.
VZ> P.S. BTW, I've added a trivial popup menu for the addresses in the viewer
Very nice, indeed.
Just a suggestion: I did not understand immediately that the
first entry in the menu has no corresponding action. Is it
possible to display it in another way (maybe in gray, as 'disabled')
so that it is clear that it is just a piece of information.
--
Xavier Nodet
PGP fingerprint: EFE0 0E75 C4DC 2654 5C36 4E2D 107C 19DE 0646 1FE2
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers