Commits on Source (4)
-
Those functions are defined in a header file which will not use them directly. `static` only will imply that the function will be used in the file including it or the header itself. `static inline` is much more suitable and will remove the unused function warning.
8ce9af05 -
This commit fixes a memory leak on playlist event. After MR !3189 [^1], the leak was fixed when closing the interface before the events are processed, but not when the events were being processed and the ownership moved to the dbus thread. When a second tracklist (append or remove) event was queued to the dbus thread, it detected that an existing event was already there and discarded the event without destroying it, despite the ownership being transferred. It is necessary to check whether the event was transferred or not and release it if not, which will be done in a following commit, but the tracklist events are gathered by the event processing code and event type duplicates don't have the same information and shouldn't be discarded first, which solves the following root leak: ==81939==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fd01ced85cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7fd00d6a3129 in tracklist_append_event_create ../../modules/control/dbus/dbus_tracklist.c:41 #2 0x7fd00d6b1f98 in playlist_on_items_added ../../modules/control/dbus/dbus.c:1063 #3 0x7fd01c03e071 in vlc_playlist_ItemsInserted ../../src/playlist/content.c:76 #4 0x7fd01c045b3e in vlc_playlist_Expand ../../src/playlist/content.c:382 #5 0x7fd01c0537e8 in vlc_playlist_ExpandItem ../../src/playlist/preparse.c:59 #6 0x7fd01c053942 in vlc_playlist_ExpandItemFromNode ../../src/playlist/preparse.c:76 #7 0x7fd01c05397f in on_subtree_added ../../src/playlist/preparse.c:87 #8 0x7fd01c070088 in OnParserSubtreeAdded ../../src/preparser/preparser.c:171 #9 0x7fd01c08848b in input_item_parser_InputEvent ../../src/input/item.c:1402 [^1]: !3189 Refs #27780 Fixes #28307
f9b56da3 -
When a second tracklist (append or remove) event was queued to the dbus thread, it detected that an existing event was already there and discarded the event without destroying it, despite the ownership being transferred. By checking whether the event was transferred or not and release it if not, we don't risk leaking the event structures and the underlying items hold by them. No functional changes since those events were not discarded anymore.
3db58145 -
Tracklist events were aggregated by the processing code into it's own linked-list which was then used to drpo the events. The code was different from how events are released when closing the application with events that were not sent to the dbus thread. This commit unify the way they are released by duplicating the existing release code matching the signal type and dropping them from the ProcessEvents function instead.
a168eb01