On Tue, 27 Jun 2000, Michael Matz wrote: > Hi, > > On Tue, 27 Jun 2000, Waldo Bastian wrote: > > Kword puts KWordDrag objects in the clipboard. After unloading KWord > > these objects don't work any longer. > > In what way? I thought the clipboard exists independent of any apps, If only. No, each application has its own clipboard. See e.g QClipboard::setData(). An application places an object in its own clipboard... when someone else "pastes" the clipboard contents it asks the application which formats it provides and then requets the data in a format that it understands. You will notice this when you select text in e.g. kedit, quit the application and then try to paste it. It will not work any longer. (When 1 application places something in its clipboard, all other apps automatically flush there clipboard, creating the idea that there is only 1 clipboard.) > so > how is unloading different of simply quitting kword (I know, that > qAddPostRoutine stuff, but still...)? Typically you don't use the clipboard any more after you quit, but you might after you have unloaded a DSO. > I mean if it crashes on unloading, > it should also crash on quitting. It doesn't crash on the unloading itself. It crashes when someone tries to use the clipboard after unloading. "using the clipboard" includes "destructing the clipboard". > QClipBoard hasn't even data members. The clipboard can store 1 "QMimeSource" object. (See data()/setData()) If that object is not a native Qt object but derived from it and defined in the DSO, it's vtables are corrupt after the DSO has unloaded. The crude solution is to call QClipboard::clear() before we unload a library. A nicer solution would be only to do that if the object in the clipboard is actually defined in the DSO. But I have no idea how to do that. Cheers, Waldo -- Make way, KDE/Linux is coming to a desktop near you!