diff options
Diffstat (limited to 'src/analysis/db')
-rw-r--r-- | src/analysis/db/items/bookmark.c | 4 | ||||
-rw-r--r-- | src/analysis/db/items/comment.c | 11 | ||||
-rw-r--r-- | src/analysis/db/items/switcher.c | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/analysis/db/items/bookmark.c b/src/analysis/db/items/bookmark.c index a3da5b3..0a64c89 100644 --- a/src/analysis/db/items/bookmark.c +++ b/src/analysis/db/items/bookmark.c @@ -537,7 +537,7 @@ static bool g_db_bookmark_run(GDbBookmark *bookmark, GLoadedBinary *binary, bool cache = g_loaded_binary_get_disassembly_cache(binary); if (cache == NULL) goto exit; - g_buffer_cache_lock(cache); + g_buffer_cache_wlock(cache); /* Recherche de la ligne concernée */ @@ -565,7 +565,7 @@ static bool g_db_bookmark_run(GDbBookmark *bookmark, GLoadedBinary *binary, bool /* Sortie */ - g_buffer_cache_unlock(cache); + g_buffer_cache_wunlock(cache); g_object_unref(G_OBJECT(cache)); diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c index 136b62b..bdff3a6 100644 --- a/src/analysis/db/items/comment.c +++ b/src/analysis/db/items/comment.c @@ -731,11 +731,12 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap const mrange_t *range; /* Emplacement d'instruction */ size_t linked; /* Indice lié à traiter */ - result = true; + result = false; cache = g_loaded_binary_get_disassembly_cache(binary); + if (cache == NULL) goto exit; - g_buffer_cache_lock(cache); + g_buffer_cache_wlock(cache) switch (comment->type) { @@ -813,10 +814,14 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap } - g_buffer_cache_unlock(cache); + g_buffer_cache_wunlock(cache); g_object_unref(G_OBJECT(cache)); + result = true; + + exit: + return result; } diff --git a/src/analysis/db/items/switcher.c b/src/analysis/db/items/switcher.c index 3ae9358..090b8ce 100644 --- a/src/analysis/db/items/switcher.c +++ b/src/analysis/db/items/switcher.c @@ -611,7 +611,7 @@ static bool g_db_switcher_run(GDbSwitcher *switcher, GLoadedBinary *binary, ImmO cursor = g_binary_cursor_new(); g_binary_cursor_update(G_BINARY_CURSOR(cursor), &switcher->addr); - g_buffer_cache_lock(cache); + g_buffer_cache_wlock(cache); index = g_buffer_cache_find_index_by_cursor(cache, cursor, true); @@ -630,7 +630,7 @@ static bool g_db_switcher_run(GDbSwitcher *switcher, GLoadedBinary *binary, ImmO exit_gui: - g_buffer_cache_unlock(cache); + g_buffer_cache_wunlock(cache); g_object_unref(G_OBJECT(cache)); |