Mac fix: Only use NSLog when GUI launched

master
Marius Kintel 2014-05-17 14:28:22 -04:00
parent 985d9a2f61
commit acab1dda1c
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,11 @@
<string>@SHORT_VERSION@</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<key>LSEnvironment</key>
<dict>
<key>GUI_LAUNCHED</key>
<string></string>
</dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>

View File

@ -582,8 +582,9 @@ int gui(const vector<string> &inputFiles, const fs::path &original_path, int arg
int main(int argc, char **argv)
{
int rc = 0;
bool isGuiLaunched = getenv("GUI_LAUNCHED") != 0;
#ifdef Q_OS_MAC
set_output_handler(CocoaUtils::nslog, NULL);
if (isGuiLaunched) set_output_handler(CocoaUtils::nslog, NULL);
#endif
#ifdef ENABLE_CGAL
// Causes CGAL errors to abort directly instead of throwing exceptions