From kde-devel Thu Dec 12 10:55:30 2002 From: Andras Mantia Date: Thu, 12 Dec 2002 10:55:30 +0000 To: kde-devel Subject: Re: strange backtrace, crashing in qt X-MARC-Message: https://marc.info/?l=kde-devel&m=103969102617928 Hi, Haven't debugged your code yet, as I couldn't compile due to a compile error, but looking at your code, I have a suggestion: delay the calling for slotFileOpen in main with a QTimer::singleShot and avoid any operation in the Bookcase constructor (and of course the methods called from it) which may require a running event loop, like displaying a dialog box. The best is to delay the whole initialiaztion with a single shot timer. Of course you must avoid to not call the slotFileOpen before your internals are properly initalized. So my concrete suggestion is: - move the whole init work in a new public method of Bookcase (let's call initEveything) - subclass KApplication (KMyApp) - in this class, create your mainwindow (new Bookcase) and call in a delayed way another method (KMyApp::slotInit) - in KMyApp::slotInit, call the Bookcase::initEvrything and the parsing of arguments + slotFileOpen - in main do the following: KApplication *app = new KMyApp; return app->exec(); I'm pretty sure that this will help you, altough it is weird that you don't see the crash. If it does not help, put traces, debug and so.... Find the exact location of crash... Andras On 2002. December 12., Thursday 06:40, Robby Stephenson wrote: > Hi, > > I've written a program I use for my book collection, called Bookcase, > available at http://www.periapsis.org/bookcase/ I've had a couple users > report crashes immediately upon application startup, and they've been kind > enough to send me backtraces. > > The problem is that it seems to be crashing somewhere within qt's internals > since nothing in the backtrace references bookcase or kde. I was wondering > if anyone has seen this before and more importantly, if you have any > suggestion about how to fix it. I hesitate to start thinking it's a qt bug > without further evidence. > > As far as I know, it's a fairly 'normal' app, made from the kdevelop > template for the most part. I don't understand backtraces all that well, > and this really has me puzzled. Everything runs fine on my Mandrake 9.0 > box, so can't reproduce it. Oh, and it's a KDE3 app. > > Thanks, > Robby [...] >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<