Move deinit_netplay to netplay.c

This commit is contained in:
twinaphex 2015-04-11 13:31:33 +02:00
parent a150cb84bd
commit 7f56e5c214
3 changed files with 12 additions and 6 deletions

View File

@ -1626,6 +1626,15 @@ void netplay_post_frame(netplay_t *netplay)
netplay_post_frame_net(netplay);
}
void deinit_netplay(void)
{
driver_t *driver = driver_get_ptr();
netplay_t *netplay = (netplay_t*)driver->netplay_data;
if (netplay)
netplay_free(netplay);
driver->netplay_data = NULL;
}
#define RARCH_DEFAULT_PORT 55435
/**

View File

@ -109,5 +109,7 @@ void netplay_post_frame(netplay_t *handle);
**/
bool init_netplay(void);
void deinit_netplay(void);
#endif

View File

@ -2765,12 +2765,7 @@ bool rarch_main_command(unsigned cmd)
break;
case RARCH_CMD_NETPLAY_DEINIT:
#ifdef HAVE_NETPLAY
{
netplay_t *netplay = (netplay_t*)driver->netplay_data;
if (netplay)
netplay_free(netplay);
driver->netplay_data = NULL;
}
deinit_netplay();
#endif
break;
case RARCH_CMD_NETWORK_DEINIT: