Commits

davep committed a01ef9b

SH-2973 Rearrange shutdown operations to prevent crash on exit on OSX

Comments (0)

Files changed (2)

indra/newview/llappviewer.cpp

 
 bool LLAppViewer::cleanup()
 {
+	//ditch LLVOAvatarSelf instance
+	gAgentAvatarp = NULL;
+
 	// workaround for DEV-35406 crash on shutdown
 	LLEventPumps::instance().reset();
 
 
 	LLAvatarIconIDCache::getInstance()->save();
 	
-	gAgentAvatarp = NULL;
-
 	LLViewerMedia::saveCookieFile();
 
 	// Stop the plugin read thread if it's running.

indra/newview/llviewerwindow.cpp

 	gSky.cleanup();
 	stop_glerror();
 
-	LLWearableList::instance().cleanup() ;
-
-	gTextureList.shutdown();
-	stop_glerror();
-
-	gBumpImageList.shutdown();
-	stop_glerror();
-
-	LLWorldMapView::cleanupTextures();
-
 	llinfos << "Cleaning up pipeline" << llendl;
 	gPipeline.cleanup();
 	stop_glerror();
 
+	//MUST clean up pipeline before cleaning up wearables
+	llinfos << "Cleaning up wearables" << llendl;
+	LLWearableList::instance().cleanup() ;
+
+	gTextureList.shutdown();
+	stop_glerror();
+
+	gBumpImageList.shutdown();
+	stop_glerror();
+
+	LLWorldMapView::cleanupTextures();
+
 	LLViewerTextureManager::cleanup() ;
 	LLImageGL::cleanupClass() ;