[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Bug in khtml (main)?
From:       Jasmin Blanchette <jasminb () corel ! com>
Date:       1999-09-29 17:17:36
[Download RAW message or body]

I guess I found a bug in khtml.cpp (main branch). I don't know if it
interests anybody; hopefully it does.

The constructor of class KHTMLWidget enables auto-deletion on a couple
of lists, among which 'formList'. The objects added to those lists are
thus deleted automatically at the end of the destructor of KHTMLWidget.
The problem is that the allocator gets deleted in the body of the
destructor, before the objects in 'formList'.

On my machine, the result was that it crached when trying to delete a
HTMLHidden object (hidden form field) that had been allocated by the
HTMLAllocator, whenever a form appeared on the HTML page. The solution
is, obviously, to clear the lists before destroying the allocator, like
this

    // the next two lines were already in the code
    delete background;
    delete ht;

    // the following lines are added
    mapPendingFiles.clear();
    framesetList.clear();
    formList.clear();
    mapList.clear();

    // the next line was already in the code
    delete allocator;

I only had problems with forms up to now, but I prefer to overkill by
clearing all of the lists.

I made the described improvement to my installation and it does not
crash anymore upon exit. I hope this will be useful to somebody.

Jasmin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic