Browse Source

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

Lee Zhen Yong 11 years ago
parent
commit
b315b90ce8
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Samples/basic/sfml2/src/main.cpp

+ 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;
 };