-
Add a helper to create RAII wrappers for C shared resources, which automatically call the Hold() and Release() functions associated to the raw pointer. Just declare a new shared resource wrapper type: using InputItemPtr = vlc_shared_data_ptr_type(input_item_t, input_item_Hold, input_item_Release); Then use this new type directly: input_item_t *ptr = /* ... */; InputItemPtr item(ptr); QString name = item->psz_name; InputItemPtr other = item; /* hold automatically */
40c6d71f