← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2748: possibly fix shutdown crash when an http dl completes during shutdown

 

------------------------------------------------------------
revno: 2748
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2011-12-25 17:47:44 +0100
message:
  possibly fix shutdown crash when an http dl completes during shutdown
modified:
  win32/MainWindow.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2011-12-23 16:21:08 +0000
+++ win32/MainWindow.cpp	2011-12-25 16:47:44 +0000
@@ -1247,6 +1247,8 @@
 }
 
 void MainWindow::completeVersionUpdate() {
+	if(!conns[CONN_VERSION]) { return; }
+
 	try {
 		SimpleXML xml;
 		xml.fromXML(conns[CONN_VERSION]->buf);
@@ -1385,7 +1387,7 @@
 
 void MainWindow::updateGeo(bool v6) {
 	auto& conn = conns[v6 ? CONN_GEO_V6 : CONN_GEO_V4];
-	if(conn.get())
+	if(conn)
 		return;
 
 	LogManager::getInstance()->message(str(F_("Updating the %1% GeoIP database...") % (v6 ? "IPv6" : "IPv4")));
@@ -1395,6 +1397,7 @@
 
 void MainWindow::completeGeoUpdate(bool v6) {
 	auto& conn = conns[v6 ? CONN_GEO_V6 : CONN_GEO_V4];
+	if(!conn) { return; }
 	ScopedFunctor([&conn] { conn.reset(); });
 
 	if(!conn->buf.empty()) {