Pārlūkot izejas kodu

Explicitly call reset on shared_ptr for potential readability boost

Dydzio 2 gadi atpakaļ
vecāks
revīzija
b5a1b178d9
2 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 2 2
      client/Client.cpp
  2. 2 2
      lib/CConsoleHandler.h

+ 2 - 2
client/Client.cpp

@@ -767,10 +767,10 @@ void CClient::removeGUI()
 	GH.curInt = nullptr;
 	if(GH.topInt())
 		GH.topInt()->deactivate();
-	adventureInt = nullptr;
+	adventureInt.reset();
 	GH.listInt.clear();
 	GH.objsToBlit.clear();
-	GH.statusbar = nullptr;
+	GH.statusbar.reset();
 	logGlobal->info("Removed GUI.");
 
 	LOCPLINT = nullptr;

+ 2 - 2
lib/CConsoleHandler.h

@@ -75,8 +75,8 @@ public:
 		funlockfile(stdout);
 #endif
 	}
-
-    std::function<void(const std::string &, bool)> *cb; //function to be called when message is received
+	//function to be called when message is received - string: message, bool: whether call was made from in-game console
+    std::function<void(const std::string &, bool)> *cb;
 
 private:
     int run();