Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix crash on launch without viewer

shun-iwasawa47356effa2d5
diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp
index 3c9d6a612..054717f4f 100644
--- a/toonz/sources/toonz/main.cpp
+++ b/toonz/sources/toonz/main.cpp
@@ -233,7 +233,7 @@ project->setUseScenePath(TProject::Extras, false);
// Imposto la rootDir per ImageCache
/*-- TOONZCACHEROOTの設定 --*/
- TFilePath cacheDir = ToonzFolder::getCacheRootFolder();
+ TFilePath cacheDir = ToonzFolder::getCacheRootFolder();
if (cacheDir.isEmpty()) cacheDir = TEnv::getStuffDir() + "cache";
TImageCache::instance()->setRootDir(cacheDir);
}
@@ -319,10 +319,10 @@ int main(int argc, char *argv[]) {
QApplication a(argc, argv);
#ifdef MACOSX
-// This workaround is to avoid missing left button problem on Qt5.6.0.
-// To invalidate m_rightButtonClicked in Qt/qnsview.mm, sending
-// NSLeftButtonDown event before NSLeftMouseDragged event propagated to
-// QApplication. See more details in ../mousedragfilter/mousedragfilter.mm.
+ // This workaround is to avoid missing left button problem on Qt5.6.0.
+ // To invalidate m_rightButtonClicked in Qt/qnsview.mm, sending
+ // NSLeftButtonDown event before NSLeftMouseDragged event propagated to
+ // QApplication. See more details in ../mousedragfilter/mousedragfilter.mm.
#include "mousedragfilter.h"
@@ -622,7 +622,8 @@ int main(int argc, char *argv[]) {
#ifdef _WIN32
// http://doc.qt.io/qt-5/windows-issues.html#fullscreen-opengl-based-windows
- QWindowsWindowFunctions::setHasBorderInFullScreen(w.windowHandle(), true);
+ if (w.windowHandle())
+ QWindowsWindowFunctions::setHasBorderInFullScreen(w.windowHandle(), true);
#endif
splash.showMessage(offsetStr + "Loading style sheet ...", Qt::AlignCenter,