ioslave terminating mechanism

Waldo Bastian bastian at kde.org
Wed Apr 17 19:41:52 BST 2002


On Wednesday 17 April 2002 08:11 am, Malte Starostik wrote:
> Not sure, but I suspect that this code in slavebase.cpp is rather
> dangerous:
>
> void genericsig_handler(int sigNumber)
> {
>    signal(sigNumber,SIG_IGN);
>    //I don't think we can have the same problem here as in the sigsegv
> handler kdDebug()<<"kioslave : exiting due to signal "<<sigNumber<<endl;
> //call the dtor of the slave and exit
>    if (globalSlave!=0)
>       globalSlave->~SlaveBase();
>    exit(2);
> };

Yes, I think the whole concept of calling a destructor there is misguided. If 
you need to clean anything up in your io-slave when you get killed you should 
install a signal handler yourself.

Cheers,
Waldo
-- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com





More information about the kde-core-devel mailing list