[Kst] LocalData needs more work

George Staikos staikos at kde.org
Thu Oct 21 20:35:08 CEST 2004


   I discovered that localdata leaks memory on plugin destruction today, but 
the proper fix is not easy.  I put in a free() for now, but if the plugin 
allocates a complex structure or array, we will still leak most of the 
memory.  The only solution I can see is to have a destructor in the plugin 
itself, such as a symbol:
void freeLocalData(void **data);

   If we see that symbol, we call it, but it is not mandatory and the fallback 
is to just use free(), perhaps with a KstDebug notice sent out.  Does this 
sound usable? (Marc-Antoine, I think you're the only person using localdata, 
so I'm particularly asking you.)

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/



More information about the Kst mailing list