[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Big trouble with KIO::NetAccess::enter_loop()
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-05-02 16:15:13
Message-ID: 200405021815.13954.bastian () kde ! org
[Download RAW message or body]

-----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@kde.org  |   SUSE Linux 9.1 Order Now!   |  bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic