From acab1dda1c4c39e006761caacaa213a808c8eb27 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 17 May 2014 14:28:22 -0400 Subject: [PATCH] Mac fix: Only use NSLog when GUI launched --- Info.plist | 5 +++++ src/openscad.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Info.plist b/Info.plist index 84b270f0..7369e2eb 100644 --- a/Info.plist +++ b/Info.plist @@ -18,6 +18,11 @@ @SHORT_VERSION@ CFBundleShortVersionString @SHORT_VERSION@ + LSEnvironment + + GUI_LAUNCHED + + CFBundleDocumentTypes diff --git a/src/openscad.cc b/src/openscad.cc index 0a62463f..3050c264 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -582,8 +582,9 @@ int gui(const vector &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