[Interest] Retrieving the object info due to exception std::bad_alloc

Ramakanth Kesireddy rama.kesi at gmail.com
Tue Feb 27 18:42:51 CET 2018


Hi,

As mentioned in http://doc.qt.io/archives/qt-4.8/exceptionsafety.html, the
below code is being used to catch the exceptions in application:-

QApplication app(argc, argv);
...
try {
app.exec();
} catch (const std::bad_alloc &) {
//clean up code and log the exception info
// retrieve class name and method name of object
return 0; // exit the application
}

Please let me know if there any means to get the runtime object info like
class name, method name(if possible line number) throwing the exception
std::bad_alloc in catch block?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180227/396fe7f5/attachment.html>


More information about the Interest mailing list