X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fcloudlog.c;h=ec168e82380aaaa4f94234c8d65bded9c3c157ab;hb=67c472ce34adf484d93c06b29cd1b822566c3b57;hp=924394844b9f6c11a4bede1f9f4cbe0f6d476d4b;hpb=0a5db8fb9777ff872240053593fd86af71360ee8;p=bluesky.git diff --git a/bluesky/cloudlog.c b/bluesky/cloudlog.c index 9243948..ec168e8 100644 --- a/bluesky/cloudlog.c +++ b/bluesky/cloudlog.c @@ -147,7 +147,10 @@ void bluesky_cloudlog_unref(BlueSkyCloudLog *log) return; } - g_hash_table_remove(fs->locations, &log->id); + if (!g_hash_table_remove(fs->locations, &log->id)) { + if (bluesky_verbose) + g_warning("Could not find and remove cloud log item from hash table!"); + } g_mutex_unlock(fs->lock); bluesky_cloudlog_stats_update(log, -1); @@ -202,6 +205,9 @@ void bluesky_cloudlog_erase(BlueSkyCloudLog *log) { g_assert(log->data_lock_count == 0); + if (log->type == LOGTYPE_UNKNOWN) + return; + log->type = LOGTYPE_UNKNOWN; log->data_size = 0; bluesky_string_unref(log->data); @@ -253,7 +259,7 @@ BlueSkyCloudLog *bluesky_cloudlog_get(BlueSkyFS *fs, BlueSkyCloudID id) item = g_hash_table_lookup(fs->locations, &id); if (item == NULL) { item = bluesky_cloudlog_new(fs, &id); - g_hash_table_insert(fs->locations, &id, item); + bluesky_cloudlog_insert_locked(item); } else { bluesky_cloudlog_ref(item); }