diff options
Diffstat (limited to 'android/protocol/core-commands-proxy.c')
-rw-r--r-- | android/protocol/core-commands-proxy.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/android/protocol/core-commands-proxy.c b/android/protocol/core-commands-proxy.c index 1bd0937..a52a376 100644 --- a/android/protocol/core-commands-proxy.c +++ b/android/protocol/core-commands-proxy.c @@ -120,27 +120,6 @@ _coreCmdProxy_get_response(UICmdRespHeader* resp, void** resp_data) return status; } -/* Destroys CoreCmdProxy instance. */ -static void -_coreCmdProxy_destroy(void) -{ - if (_coreCmdProxy.sync_writer != NULL) { - syncsocket_close(_coreCmdProxy.sync_writer); - syncsocket_free(_coreCmdProxy.sync_writer); - _coreCmdProxy.sync_writer = NULL; - } - if (_coreCmdProxy.sync_reader != NULL) { - syncsocket_close(_coreCmdProxy.sync_reader); - syncsocket_free(_coreCmdProxy.sync_reader); - _coreCmdProxy.sync_reader = NULL; - } - if (_coreCmdProxy.core_connection != NULL) { - core_connection_close(_coreCmdProxy.core_connection); - core_connection_free(_coreCmdProxy.core_connection); - _coreCmdProxy.core_connection = NULL; - } -} - int corecmd_set_coarse_orientation(AndroidCoarseOrientation orient) { @@ -351,13 +330,13 @@ coreCmdProxy_create(SockAddress* console_socket) _coreCmdProxy.sync_writer = syncsocket_init(_coreCmdProxy.sock); if (_coreCmdProxy.sync_writer == NULL) { derror("Unable to initialize CoreCmdProxy writer: %s\n", errno_str); - _coreCmdProxy_destroy(); + coreCmdProxy_destroy(); return -1; } _coreCmdProxy.sync_reader = syncsocket_init(_coreCmdProxy.sock); if (_coreCmdProxy.sync_reader == NULL) { derror("Unable to initialize CoreCmdProxy reader: %s\n", errno_str); - _coreCmdProxy_destroy(); + coreCmdProxy_destroy(); return -1; } @@ -374,3 +353,24 @@ coreCmdProxy_create(SockAddress* console_socket) return 0; } + +/* Destroys CoreCmdProxy instance. */ +void +coreCmdProxy_destroy(void) +{ + if (_coreCmdProxy.sync_writer != NULL) { + syncsocket_close(_coreCmdProxy.sync_writer); + syncsocket_free(_coreCmdProxy.sync_writer); + _coreCmdProxy.sync_writer = NULL; + } + if (_coreCmdProxy.sync_reader != NULL) { + syncsocket_close(_coreCmdProxy.sync_reader); + syncsocket_free(_coreCmdProxy.sync_reader); + _coreCmdProxy.sync_reader = NULL; + } + if (_coreCmdProxy.core_connection != NULL) { + core_connection_close(_coreCmdProxy.core_connection); + core_connection_free(_coreCmdProxy.core_connection); + _coreCmdProxy.core_connection = NULL; + } +} |