[Qt5-feedback] new Qt5 - great! - but: What about exceptions?

Thiago Macieira thiago at kde.org
Mon May 16 14:40:41 CEST 2011


On Monday, 16 de May de 2011 11:22:41 André Pönitz wrote:
> - Qt code right now is not exception safe. "Fixing" that is a huge effort. 
> You can easily sink a few months of work here. A few of the "maintainer 
> wanted" items take significantly less effort, so from my point of view any 
> free capacities you might have would be spent better otherwise.

What we agreed during the Symbian port times was:

 - full exception safety on the Qt container classes, like QVector, QList, 
etc.

 - have the event loop cleanly exit if an exception is thrown from inside. If 
we can't propagate through third-party code, catch the exception, consume it 
and throw a generic one from Qt code again. (except for std::bad_alloc, that 
should be rethrown as-is) Restarting the event loop after an exception was 
leaked through it is undefined behaviour.

   Note that I've got some work that stops trying to catch the exception, but 
simply lets it propagate through. (No catch {} blocks)

 - this includes the signal-slot mechanism too

 - the rest of the classes as exception-unsafe and may crash or freeze if an 
unexpected exception is thrown (including std::bad_alloc)


-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt.nokia.com/pipermail/qt5-feedback/attachments/20110516/57ea07d8/attachment.bin 


More information about the Qt5-feedback mailing list