我有一些Lua的綁定Qt的是找工作在Mac OS X(QT 4.8.0),但墜毀在Ubuntu Linux(QT 4.7.4)。 Qt的代碼加載有dlopen的,然後執行被傳遞與APP-> exec來QT()。如何在作爲共享庫加載時正確關閉Qt?
Lua代碼:
require 'mimas' -- Load shared library mimas.so linked to Qt libs
app = mimas.Application() -- Just a wrapper around QApplication
app:exec()
-- In some callback: app:quit()
當Lua退出(後應用程式:EXEC()返回時),它在其上一個SIGSEGV結束的 '土衛' 共享庫dlclose。回溯:
Program received signal SIGSEGV, Segmentation fault.
QList<QFactoryLoader*>::removeAll (this=0x0, [email protected])
at ../../include/QtCore/../../src/corelib/tools/qlist.h:760
760 ../../include/QtCore/../../src/corelib/tools/qlist.h: No such file or directory.
in ../../include/QtCore/../../src/corelib/tools/qlist.h
(gdb) bt
#0 QList<QFactoryLoader*>::removeAll (this=0x0, [email protected])
at ../../include/QtCore/../../src/corelib/tools/qlist.h:760
#1 0x0131126c in QFactoryLoader::~QFactoryLoader (this=0x8104a48,
__in_chrg=<optimized out>) at plugin/qfactoryloader.cpp:208
#2 0x01311302 in QFactoryLoader::~QFactoryLoader (this=0x8104a48,
__in_chrg=<optimized out>) at plugin/qfactoryloader.cpp:209
#3 0x009143a8 in QGlobalStaticDeleter<QFactoryLoader>::~QGlobalStaticDeleter (
this=0x11c3200, __in_chrg=<optimized out>)
at ../../include/QtCore/../../src/corelib/global/qglobal.h:1825
#4 0x001e7d2b in __cxa_finalize() from /lib/i386-linux-gnu/libc.so.6
#5 0x00842a94 in __do_global_dtors_aux()
from /usr/lib/i386-linux-gnu/libQtGui.so.4
[snip]
#13 0x0016bd28 in dlclose() from /lib/i386-linux-gnu/libdl.so.2
如何關閉Qt的正確,這樣它不會在此內存錯誤結束?
這個問題似乎是qt_factory_loaders()返回null。我將嘗試使用Qt 4.8.0來查看事情是否發生了變化。
[編輯]我可以縮小問題(這是不相關的LUA)和填充bug report QT間期。
應用程式:退出()是Qt是如何停止和應用程式:EXEC()返回。在這一步之後發生崩潰。 – gaspard 2012-03-21 13:50:36