@@ -62,9 +62,9 @@ bool init(std::string& executable, SOCKET socket, std::string& application_ident
62
62
return true ;
63
63
}
64
64
65
- bool run_application (std::string& executable, SOCKET socket, std::string& application_identifier, std::map<std::string, ApplicationCache>& apps_cache )
65
+ bool run_application (std::string& executable, SOCKET socket, std::string& application_identifier, DeviceData* device_data )
66
66
{
67
- RETURN_IF_FALSE (init (executable, socket, application_identifier, apps_cache));
67
+ RETURN_IF_FALSE (init (executable, socket, application_identifier, device_data-> apps_cache ));
68
68
// Couldn't find official info on this but I'm guessing this is the method we need to call
69
69
RETURN_IF_FALSE (await_response (" qLaunchSuccess" , socket));
70
70
// vCont specifies a command to be run - c means continue
@@ -81,6 +81,9 @@ bool run_application(std::string& executable, SOCKET socket, std::string& applic
81
81
// We have decided we do not need this at the moment, but it is vital that it be read from the pipe
82
82
// Else it will remain there and may be read later on and mistaken for a response to same other package
83
83
std::string answer = receive_message_raw (socket);
84
+
85
+ detach_connection (socket, application_identifier, device_data);
86
+
84
87
return true ;
85
88
}
86
89
@@ -130,4 +133,5 @@ void detach_connection(SOCKET socket, std::string& application_identifier, Devic
130
133
std::string answer = receive_message_raw (socket);
131
134
device_data->apps_cache [application_identifier].has_initialized_gdb = false ;
132
135
device_data->services .erase (kDebugServer );
136
+ close (socket);
133
137
}
0 commit comments