FS-10167: Bug fixes, memory leaks, etc

This commit is contained in:
Shane Bryldt 2017-07-03 13:45:29 -06:00
parent f9d23ccadd
commit 2ff3ce1a5c
4 changed files with 15 additions and 6 deletions

View File

@ -1084,7 +1084,7 @@ KS_DECLARE(ks_status_t) blade_protocol_subscribe(blade_handle_t *bh, const char
}
ks_pool_free(bh->pool, &localid);
if (bsub) {
if (!remove && bsub) {
blade_subscription_callback_set(bsub, event_callback);
blade_subscription_callback_data_set(bsub, event_data);
}

View File

@ -184,7 +184,8 @@ KS_DECLARE(blade_transport_t *) blade_transportmgr_transport_lookup(blade_transp
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;
// @todo if (bt) blade_transport_read_lock(bt);
ks_hash_read_unlock(btmgr->transports);

View File

@ -292,14 +292,19 @@ int main(int argc, char **argv)
if (autoconnect) {
blade_connection_t *bc = NULL;
blade_identity_t *target = NULL;
ks_bool_t connected = KS_FALSE;
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);
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);

View File

@ -73,14 +73,17 @@ ks_status_t testproto_create(testproto_t **testP, blade_handle_t *bh)
ks_status_t testproto_destroy(testproto_t **testP)
{
testproto_t *test = NULL;
//ks_pool_t *pool = NULL;
ks_pool_t *pool = NULL;
ks_assert(testP);
ks_assert(*testP);
test = *testP;
pool = test->pool;
ks_pool_free(test->pool, testP);
ks_pool_close(&pool);
*testP = NULL;
return KS_STATUS_SUCCESS;
}