[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#383193: Upcomming Krusader-1.80.0-beta1 and Debian bug #403130, ftp problem



Is it fault of the program (it is illegal to call qApp->processEvents()
while other such call is running), or is it fault of the KDE library?

The qApp->processEvents() function works properly, but can cause many problems if you use it. It's like multi threading, but even more
dangerous...

Nobody knows what will happen in this function. We used it as it's very
convenient, produces nice, readable codes, but crashes as well.

Sample:

QObject * resource = ...
while( !ioEnded )
   qApp->processEvents();
resource->method( ... );


- create an object (resource)
- start an IO operation -> while it's not finished, call
  qApp->processEvents
------------- in processing events ------------------------
- the user clicks to close the window
- at closing the window all resource will be freed
- IO is aborted
------------- gets out from process events -------------
- from here all variables are freed because the user exited...
- crash...

It's so simple.

Csaba



Reply to: