[Development] Ref-counted quit

Thiago Macieira thiago.macieira at intel.com
Mon Jan 2 15:31:53 CET 2012


On Monday, 2 de January de 2012 14.47.20, Olivier Goffart wrote:
> > > > It sounds like the QCoreApplication object will be deleted when the
> > > > count reaches zero, which isn't true.
> > >
> > > Yes, it is true.
> >
> > To be clear: are you agreeing with me ("what you said is true") or are you
> > disagreeing with me ("what you said isn't true actually is true") ?
> 
> "what you said isn't true actually is true"

bool mycondition = true;

int main(int argc, char **argv)
{
     QCoreApplication app(argc, argv);
     while (mycondition) {
         app.exec();
     }
}

The reference counter going to zero does not cause the QCoreApplication to be 
deleted. It merely causes the event loop to exit. That's why I call it ugly 
and under-defined.

I may be persuaded to allow a simple API in QtCore, if you guys can propose a 
good API, but I will definitely not agree to it being ref() and deref() in 
QCoreApplication.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120102/5b776b24/attachment.sig>


More information about the Development mailing list