[Qt-interest] Mac Sparkle updater "install and relaunch" crashing Qt app

Tonu Jaansoo chain at bsd.ee
Thu Apr 1 19:18:43 CEST 2010


Ok .. i can answer this now. Termination has to be done in a nice way, using objc-runtime magic. First time I use poseAs :)

so just for the reference .. if anybody wants to use Sparkle, this is the way:

main.mm
-------------------------
#include <QApplication>

#include "mainwindow.h"

#ifdef Q_WS_MAC
#include <AppKit/NSApplication.h>
#include <Sparkle/Sparkle.h>
#import <objc/objc-runtime.h>
#endif

@interface MyNSApplication : NSApplication
@end

@implementation MyNSApplication
- (void) terminate:(id)sender
{
     qApp->quit();
}
@end

int main(int argc, char *argv[])
{
#ifdef Q_WS_MAC
    class_poseAs ([MyNSApplication class], [NSApplication class]);
#endif

    QApplication a(argc, argv);

#ifdef Q_WS_MAC
    NSApplicationLoad();
    [[NSAutoreleasePool alloc] init];

    SUUpdater * updater = [[SUUpdater sharedUpdater] retain];

    [updater checkForUpdatesInBackground];
#endif
    
    MainWindow w;
    w.show();

    return a.exec();
}






On Apr 1, 2010, at 9:57 AM, Tonu Jaansoo wrote:

> I would like to point out that this was not april fool's joke :)
> Does it seem that its a bug in Qt?
> 
> On Mar 31, 2010, at 8:38 PM, Tonu Jaansoo wrote:
> 
>> Hi!
>> 
>> Can anybody figure out something from this? I have app crashing when i click "install and relaunch" in Sparkle updater window.
>> I am using MacOS 10.6., Qt 4.6.1 and latest Sparkle
>> 
>> Crash log:
>> 
>> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
>> 0   QtGui                         	0x028ae624 QImagePixmapCleanupHooks::executePixmapDestructionHooks(QPixmap*) + 20
>> 1   QtGui                         	0x0289e21e QPixmap::~QPixmap() + 142
>> 2   QtGui                         	0x028a15a4 QPixmapCache::find(QPixmapCache::Key const&, QPixmap*) + 196
>> 3   QtGui                         	0x028a192f QPixmapCache::find(QString const&) + 191
>> 4   QtGui                         	0x028a1a72 QPixmapCache::clear() + 82
>> 5   QtGui                         	0x028a0e21 QPixmapCache::cacheLimit() + 225
>> 6   libSystem.B.dylib             	0x90ec298f __cxa_finalize + 208
>> 7   libSystem.B.dylib             	0x90ec28a4 exit + 33
>> 8   com.apple.AppKit              	0x95cc0002 -[NSApplication terminate:] + 1056
>> 9   com.apple.Foundation          	0x9332fea8 __NSThreadPerformPerform + 705
>> 10  com.apple.CoreFoundation      	0x93f088cb __CFRunLoopDoSources0 + 1563
>> 11  com.apple.CoreFoundation      	0x93f0638f __CFRunLoopRun + 1071
>> 12  com.apple.CoreFoundation      	0x93f05864 CFRunLoopRunSpecific + 452
>> 13  com.apple.CoreFoundation      	0x93f05691 CFRunLoopRunInMode + 97
>> 14  QtGui                         	0x027a4700 non-virtual thunk to QDesktopWidget::~QDesktopWidget() + 3520
>> 15  QtCore                        	0x033b88d1 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 65
>> 16  QtCore                        	0x033b8afd QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 189
>> 17  QtCore                        	0x033bac3e QCoreApplication::exec() + 174
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest





More information about the Qt-interest-old mailing list