Big trouble with KIO::NetAccess::enter_loop()

Waldo Bastian bastian at kde.org
Sun May 2 17:15:13 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun May 2 2004 17:07, Michael Brade wrote:
> > If it's called twice, there's no real NetAccess bug
> > (it's not supposed to be called recursively)
>
> Hmm, do you know why exactly this doesn't work?

You will get two nested event-loops both waiting for one particular job to 
finish, but the first job that finishes will finish the inner loop, even 
though the job that finished could have belonged to the outer loop. In that 
case the inner loop exits and the outer loop will keep running despite the 
fact that the job asscoiated with that loop has finished already.

In visual form:

[
   acces1 = new KIO::NetAccess;
   job1= new KIO::Job;
   qApp->enter_loop()
   [
      acces2 = new KIO::NetAccess;
      job2 = new job;
      qApp->enter_loop()
      [
         access1::slotResult  // job1 finishes
         // and calls
         qApp->exit_loop();
      ]
      delete acces2
      
      // access1::slotResult never gets called again because
      // job1 is finished already

      // access2::slotResult doesn't get called when job2 finishes because
      // access2 has been deleted already
      
      //  qApp->exit_loop(); is never called and we are stuck here for ever
   ]

Cheers,
Waldo
- -- 
bastian at kde.org  |   SUSE Linux 9.1 Order Now!   |  bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAlR6RN4pvrENfboIRAhRUAJ48G3cb4cu0KJNDEaEwX4E2wPAZMgCgnMFr
yhViGaha0ujeNk5AGeUTP8s=
=H4zR
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list