Changeset 4440 for pjproject/trunk/pjsip-apps/src/pjsua/main.c
- Timestamp:
- Mar 14, 2013 7:18:13 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/main.c
r3664 r4440 30 30 pj_status_t app_init(int argc, char *argv[]); 31 31 pj_status_t app_main(void); 32 pj_status_t app_destroy(void); 33 32 pj_status_t app_destroy(); 33 pj_status_t receive_end_sig; 34 pj_thread_t *sig_thread; 34 35 35 36 #if defined(PJ_WIN32) && PJ_WIN32!=0 … … 39 40 40 41 static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) 41 { 42 pj_thread_t *thread; 43 42 { 44 43 switch (fdwCtrlType) 45 44 { … … 51 50 case CTRL_LOGOFF_EVENT: 52 51 case CTRL_SHUTDOWN_EVENT: 53 pj_thread_register("ctrlhandler", handler_desc, & thread);52 pj_thread_register("ctrlhandler", handler_desc, &sig_thread); 54 53 PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); 55 app_destroy(); 54 receive_end_sig = PJ_TRUE; 55 app_destroy(); 56 56 ExitProcess(1); 57 57 PJ_UNREACHED(return TRUE;) … … 88 88 static int main_func(int argc, char *argv[]) 89 89 { 90 receive_end_sig = PJ_FALSE; 90 91 setup_socket_signal(); 91 92 … … 99 100 100 101 app_main(); 101 app_destroy(); 102 if (!receive_end_sig) { 103 app_destroy(); 102 104 103 /* This is on purpose */ 104 app_destroy(); 105 /* This is on purpose */ 106 app_destroy(); 107 } else { 108 pj_thread_join(sig_thread); 109 } 105 110 } while (app_restart); 106 111
Note: See TracChangeset
for help on using the changeset viewer.