- Timestamp:
- Jun 25, 2009 1:01:06 PM (15 years ago)
- Location:
- pjproject/branches/1.0/pjsip/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.0/pjsip/src/pjsip-ua/sip_inv.c
r2803 r2811 1368 1368 1369 1369 status = pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 1370 if (status != PJ_SUCCESS) 1370 if (status != PJ_SUCCESS) { 1371 pjsip_tx_data_dec_ref(tdata); 1371 1372 goto on_return; 1373 } 1372 1374 1373 1375 tdata->msg->body = create_sdp_body(tdata->pool, offer); -
pjproject/branches/1.0/pjsip/src/pjsua-lib/pjsua_call.c
r2802 r2811 449 449 } 450 450 451 /* Increment the dialog's lock otherwise when invite session creation 452 * fails the dialog will be destroyed prematurely. 453 */ 454 pjsip_dlg_inc_lock(dlg); 455 451 456 /* Calculate call's secure level */ 452 457 call->secure_level = get_secure_level(acc_id, dest_uri); … … 539 544 status); 540 545 541 /* Upon failure to send first request, both dialog andinvite546 /* Upon failure to send first request, the invite 542 547 * session would have been cleared. 543 548 */ 544 549 inv = NULL; 545 dlg = NULL;546 550 goto on_error; 547 551 } … … 552 556 *p_call_id = call_id; 553 557 558 pjsip_dlg_dec_lock(dlg); 554 559 pj_pool_release(tmp_pool); 555 560 PJSUA_UNLOCK(); … … 559 564 560 565 on_error: 566 if (dlg) { 567 /* This may destroy the dialog */ 568 pjsip_dlg_dec_lock(dlg); 569 } 570 561 571 if (inv != NULL) { 562 572 pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE); 563 } else if (dlg) {564 pjsip_dlg_terminate(dlg);565 573 } 566 574 -
pjproject/branches/1.0/pjsip/src/pjsua-lib/pjsua_pres.c
r2394 r2811 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.