wx/playlist: never store the pointer to p_item when the playlist lock isn't

held. store p_playlist in wxvlc::Playlist since the class can't work without
p_playlist anyway. Strictly lock playlist when needed.

adds a lot of playlist_ItemGetById, and removes a lot of vlc_object_find
VLC_OBJECT_PLAYLIST).

This should fix a lot of potential deadlocks and crashes, including a few I
could reproduce
parent 5c6d8629
This diff is collapsed.
......@@ -891,9 +891,9 @@ private:
/* Popup */
wxMenu *item_popup;
wxMenu *node_popup;
wxTreeItemId i_popup_item;
playlist_item_t *p_popup_item;
playlist_item_t *p_popup_parent;
wxTreeItemId i_wx_popup_item;
int i_popup_item;
int i_popup_parent;
void OnPopup( wxContextMenuEvent& event );
void OnPopupPlay( wxCommandEvent& event );
void OnPopupPreparse( wxCommandEvent& event );
......@@ -903,23 +903,24 @@ private:
void OnPopupInfo( wxCommandEvent& event );
void Rebuild( vlc_bool_t );
void Preparse( playlist_t *p_playlist );
void Preparse();
/* Update */
void UpdateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
void UpdateNodeChildren( playlist_t *, playlist_item_t*, wxTreeItemId );
void CreateNode( playlist_t *, playlist_item_t*, wxTreeItemId );
void UpdateTreeItem( playlist_t *, wxTreeItemId );
void UpdateNode( playlist_item_t*, wxTreeItemId );
void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
void CreateNode( playlist_item_t*, wxTreeItemId );
void UpdateTreeItem( wxTreeItemId );
/* Search (internal) */
int CountItems( wxTreeItemId);
wxTreeItemId FindItem( wxTreeItemId, playlist_item_t * );
wxTreeItemId FindItem( wxTreeItemId, int );
wxTreeItemId FindItemByName( wxTreeItemId, wxString,
wxTreeItemId, vlc_bool_t *);
wxTreeItemId saved_tree_item;
playlist_item_t *p_saved_item;
int i_saved_id;
playlist_t *p_playlist;
/* Custom events */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment