diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-03-02 11:58:00 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-03-02 11:58:00 +0000 |
| commit | 99454639cd14557dca19e2ffbbaf1f57f1930309 (patch) | |
| tree | f31280893cf23f9f6e89d3e6b68137fa70ca1889 | |
| parent | 75598ef566e3cb6012905b504866736daf9d8f2f (diff) | |
| download | lasso-99454639cd14557dca19e2ffbbaf1f57f1930309.tar.gz lasso-99454639cd14557dca19e2ffbbaf1f57f1930309.tar.xz lasso-99454639cd14557dca19e2ffbbaf1f57f1930309.zip | |
Core: add macro to remove gobject from lists
| -rw-r--r-- | lasso/utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lasso/utils.h b/lasso/utils.h index 4143e3cb..09030b6b 100644 --- a/lasso/utils.h +++ b/lasso/utils.h @@ -375,6 +375,12 @@ } \ } +/* List element removal */ +#define lasso_list_remove_gobject(list, gobject) \ + do { void *__tmp = gobject; GList **__tmp_list = &(list); \ + *__tmp_list = g_list_remove(*__tmp_list, __tmp); \ + lasso_unref(__tmp); } while(0) + /* Pointer ownership transfer */ /* lasso_transfer_xxx macros are like lasso_assign_xxx but they do not increment reference count or |
