Changeset 2593 for pjproject/trunk
- Timestamp:
- Apr 14, 2009 11:10:31 AM (16 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsua-lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r2506 r2593 468 468 } 469 469 470 /* Increment the dialog's lock otherwise when invite session creation 471 * fails the dialog will be destroyed prematurely. 472 */ 473 pjsip_dlg_inc_lock(dlg); 474 470 475 /* Calculate call's secure level */ 471 476 call->secure_level = get_secure_level(acc_id, dest_uri); … … 558 563 status); 559 564 560 /* Upon failure to send first request, both dialog andinvite565 /* Upon failure to send first request, the invite 561 566 * session would have been cleared. 562 567 */ 563 568 inv = NULL; 564 dlg = NULL;565 569 goto on_error; 566 570 } … … 571 575 *p_call_id = call_id; 572 576 577 pjsip_dlg_dec_lock(dlg); 573 578 pj_pool_release(tmp_pool); 574 579 PJSUA_UNLOCK(); … … 578 583 579 584 on_error: 585 if (dlg) { 586 /* This may destroy the dialog */ 587 pjsip_dlg_dec_lock(dlg); 588 } 589 580 590 if (inv != NULL) { 581 591 pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE); 582 } else if (dlg) {583 pjsip_dlg_terminate(dlg);584 592 } 585 593 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r2394 r2593 1443 1443 } 1444 1444 1445 /* Increment the dialog's lock otherwise when presence session creation 1446 * fails the dialog will be destroyed prematurely. 1447 */ 1448 pjsip_dlg_inc_lock(buddy->dlg); 1449 1445 1450 status = pjsip_pres_create_uac( buddy->dlg, &pres_callback, 1446 1451 PJSIP_EVSUB_NO_EVENT_ID, &buddy->sub); … … 1449 1454 pjsua_perror(THIS_FILE, "Unable to create presence client", 1450 1455 status); 1451 pjsip_dlg_terminate(buddy->dlg); 1456 /* This should destroy the dialog since there's no session 1457 * referencing it 1458 */ 1459 pjsip_dlg_dec_lock(buddy->dlg); 1452 1460 if (tmp_pool) pj_pool_release(tmp_pool); 1453 1461 return; … … 1482 1490 status = pjsip_pres_initiate(buddy->sub, -1, &tdata); 1483 1491 if (status != PJ_SUCCESS) { 1492 pjsip_dlg_dec_lock(buddy->dlg); 1484 1493 if (buddy->sub) { 1485 1494 pjsip_pres_terminate(buddy->sub, PJ_FALSE); … … 1496 1505 status = pjsip_pres_send_request(buddy->sub, tdata); 1497 1506 if (status != PJ_SUCCESS) { 1507 pjsip_dlg_dec_lock(buddy->dlg); 1498 1508 if (buddy->sub) { 1499 1509 pjsip_pres_terminate(buddy->sub, PJ_FALSE); … … 1506 1516 } 1507 1517 1518 pjsip_dlg_dec_lock(buddy->dlg); 1508 1519 if (tmp_pool) pj_pool_release(tmp_pool); 1509 1520 }
Note: See TracChangeset
for help on using the changeset viewer.