mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-31 02:33:44 +00:00
FS-10167: Bug fixes, memory leaks, etc
This commit is contained in:
parent
f9d23ccadd
commit
2ff3ce1a5c
@ -1084,7 +1084,7 @@ KS_DECLARE(ks_status_t) blade_protocol_subscribe(blade_handle_t *bh, const char
|
|||||||
}
|
}
|
||||||
ks_pool_free(bh->pool, &localid);
|
ks_pool_free(bh->pool, &localid);
|
||||||
|
|
||||||
if (bsub) {
|
if (!remove && bsub) {
|
||||||
blade_subscription_callback_set(bsub, event_callback);
|
blade_subscription_callback_set(bsub, event_callback);
|
||||||
blade_subscription_callback_data_set(bsub, event_data);
|
blade_subscription_callback_data_set(bsub, event_data);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,8 @@ KS_DECLARE(blade_transport_t *) blade_transportmgr_transport_lookup(blade_transp
|
|||||||
|
|
||||||
ks_assert(btmgr);
|
ks_assert(btmgr);
|
||||||
|
|
||||||
if (name && name[0]) bt = (blade_transport_t *)ks_hash_search(btmgr->transports, (void *)name, KS_READLOCKED);
|
ks_hash_read_lock(btmgr->transports);
|
||||||
|
if (name && name[0]) bt = (blade_transport_t *)ks_hash_search(btmgr->transports, (void *)name, KS_UNLOCKED);
|
||||||
if (!bt && ordefault) bt = btmgr->default_transport;
|
if (!bt && ordefault) bt = btmgr->default_transport;
|
||||||
// @todo if (bt) blade_transport_read_lock(bt);
|
// @todo if (bt) blade_transport_read_lock(bt);
|
||||||
ks_hash_read_unlock(btmgr->transports);
|
ks_hash_read_unlock(btmgr->transports);
|
||||||
|
@ -292,14 +292,19 @@ int main(int argc, char **argv)
|
|||||||
if (autoconnect) {
|
if (autoconnect) {
|
||||||
blade_connection_t *bc = NULL;
|
blade_connection_t *bc = NULL;
|
||||||
blade_identity_t *target = NULL;
|
blade_identity_t *target = NULL;
|
||||||
|
ks_bool_t connected = KS_FALSE;
|
||||||
|
|
||||||
blade_identity_create(&target, blade_handle_pool_get(bh));
|
blade_identity_create(&target, blade_handle_pool_get(bh));
|
||||||
|
|
||||||
if (blade_identity_parse(target, autoconnect) == KS_STATUS_SUCCESS) blade_handle_connect(bh, &bc, target, NULL);
|
if (blade_identity_parse(target, autoconnect) == KS_STATUS_SUCCESS) connected = blade_handle_connect(bh, &bc, target, NULL) == KS_STATUS_SUCCESS;
|
||||||
|
|
||||||
blade_identity_destroy(&target);
|
blade_identity_destroy(&target);
|
||||||
|
|
||||||
ks_sleep_ms(3000);
|
|
||||||
|
if (connected) {
|
||||||
|
// @todo use session state change callback to know when the session is ready and the realm(s) available from blade.connect
|
||||||
|
ks_sleep_ms(3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loop(bh);
|
loop(bh);
|
||||||
|
@ -73,14 +73,17 @@ ks_status_t testproto_create(testproto_t **testP, blade_handle_t *bh)
|
|||||||
ks_status_t testproto_destroy(testproto_t **testP)
|
ks_status_t testproto_destroy(testproto_t **testP)
|
||||||
{
|
{
|
||||||
testproto_t *test = NULL;
|
testproto_t *test = NULL;
|
||||||
//ks_pool_t *pool = NULL;
|
ks_pool_t *pool = NULL;
|
||||||
|
|
||||||
ks_assert(testP);
|
ks_assert(testP);
|
||||||
ks_assert(*testP);
|
ks_assert(*testP);
|
||||||
|
|
||||||
test = *testP;
|
test = *testP;
|
||||||
|
pool = test->pool;
|
||||||
|
|
||||||
ks_pool_free(test->pool, testP);
|
ks_pool_close(&pool);
|
||||||
|
|
||||||
|
*testP = NULL;
|
||||||
|
|
||||||
return KS_STATUS_SUCCESS;
|
return KS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user