← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1725: 1. Fix startup crash if no $DISPLAY set at all

 

------------------------------------------------------------
revno: 1725
committer: Václav Šmilauer <vaclav@flux>
branch nick: trunk
timestamp: Sun 2009-08-23 08:48:29 +0200
message:
  1. Fix startup crash if no $DISPLAY set at all
modified:
  core/yade.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'core/yade.cpp'
--- core/yade.cpp	2009-08-20 09:38:22 +0000
+++ core/yade.cpp	2009-08-23 06:48:29 +0000
@@ -304,7 +304,7 @@
 	#else
 		if(gui=="QtGUI"){LOG_WARN("openGL-less build, using PythonUI instead of QtGUI"); gui="PythonUI";}
 	#endif
-	if(string(getenv("DISPLAY")).empty()) unsetenv("DISPLAY"); // empty $DISPLAY is no display
+	if(getenv("DISPLAY") && string(getenv("DISPLAY")).empty()) unsetenv("DISPLAY"); // empty $DISPLAY is no display
 	if(gui=="QtGUI" && !getenv("DISPLAY")){ LOG_WARN("No $DISPLAY, using PythonUI instead of QtUI"); gui="PythonUI"; }
 	shared_ptr<FrontEnd> frontEnd;
 	try{