Patch: fix intermittent crash in KHTML Thai Word Break

Germain Garand germain at ebooksfrance.org
Mon Feb 28 19:09:43 GMT 2005


Le lundi 28 Février 2005 17:20, David Faure a écrit :
> On Monday 28 February 2005 18:24, Germain Garand wrote:
> > Oh I see...  there is no proper initialization for th_brk.
> > So then the only needed change should be:
> > - static th_brk_def th_brk;
> > + static th_brk_def th_brk = 0;
>
> AFAIK file-static data is initialized to 0 automatically.

ah, I didn't know that... but initialization of statics would only happens 
once, when a library is dynamically loaded, no?

some times ago we had a bug in the arena allocator, where if the last part was 
unloaded and KHTMLFactory destroyed, static variables remain, so next time a 
KHTMLPart was created, statics were not reinitialized.

This would explain (what looks like) invalid reads on the cache structure...

    void cleanup_thaibreaks()
    {
        delete cache;
+        cache = 0;
    }

Germain




More information about the kfm-devel mailing list