Эх сурвалжийг харах

bug fix: SFML2 example runtime error when application closes, caused by memory leaks

Lee Zhen Yong 11 жил өмнө
parent
commit
b315b90ce8

+ 4 - 1
Samples/basic/sfml2/src/main.cpp

@@ -155,7 +155,7 @@ int main(int argc, char **argv)
 					SystemInterface.GetKeyModifiers(&MyWindow));
 				break;
 			case sf::Event::Closed:
-				return 1;
+				MyWindow.close();
 				break;
 			};
 		};
@@ -163,5 +163,8 @@ int main(int argc, char **argv)
 		Context->Update();
 	};
 
+	Context->RemoveReference();
+	Rocket::Core::Shutdown();
+
 	return 0;
 };