project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netconn.java
changeset 7349 12fdfd2038d4
parent 7342 0e29eec2df5c
child 7352 641f11cdd319
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netconn.java	Thu Jul 19 22:55:36 2012 +0200
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/netplay/Netconn.java	Sat Jul 21 14:56:52 2012 +0200
@@ -99,6 +99,13 @@
 		}
 	};
 	
+	private IntStrCallback disconnectCb = new IntStrCallback() {
+		public void callback(Pointer context, int arg1, String arg2) {
+			FLIB.flib_netconn_destroy(conn);
+			conn = null;
+		}
+	};
+	
 	/**
 	 * Connect to the official Hedgewars server.
 	 * 
@@ -142,6 +149,7 @@
 			FLIB.flib_netconn_onRoomDelete(conn, roomDeleteCb, null);
 			FLIB.flib_netconn_onConnected(conn, connectedCb, null);
 			FLIB.flib_netconn_onRoomlist(conn, roomlistCb, null);
+			FLIB.flib_netconn_onDisconnected(conn, disconnectCb, null);
 		} finally {
 			FLIB.flib_metascheme_release(meta);
 		}