[Clam-devel] Turnaround: progress dialog crash

David García Garzón dgarcia at iua.upf.edu
Tue Aug 12 10:20:38 PDT 2008


Pawel, i know that is weird that increasing the progress bar make the app to 
crash but disabling it is not the solution. Some insight on the matter 
follows:

ProgressBar::setValue calls a function that serves all the pending qt events 
(qApp::ProcessPendingEventS()) in order not to freeze the interface while 
executing a long task. If the progress bar itself didn't do it, we should 
have called that ourselves. That call is the one that makes all crash but it 
is not its fault.

Why it crashes and it doesn't when you disable it? Because when disabled no 
redraw event is sent. When drawing the widgets the widgets access to the 
datasources and datasources are pointing to a memory that is not available. 
It may happen that the memory belonging to the source is still ours because 
we allocated new objects in that memory and this situation doesn't crash 
(still a bug!!!), but when object are smaller (shorter songs) chances are 
greatter that we access foreign memory and then the crash.

So the good solution is to set the widgets data sources to 0 again, before 
computing the chords. This way, adding the progress dialog cancel button 
would be also safe.

David.








More information about the clam-devel mailing list