Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
0132bb5d
Commit
0132bb5d
authored
Oct 27, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: fix #3113: crash after a playlist item is removed by another plugin
parent
efb6cbba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+11
-7
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+1
-1
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
0132bb5d
...
...
@@ -653,9 +653,6 @@ void PLModel::processInputItemUpdate( input_item_t *p_item )
void
PLModel
::
processItemRemoval
(
int
i_id
)
{
if
(
i_id
<=
0
)
return
;
if
(
i_id
==
i_cached_id
)
i_cached_id
=
-
1
;
i_cached_input_id
=
-
1
;
removeItem
(
i_id
);
}
...
...
@@ -760,13 +757,22 @@ void PLModel::removeItem( PLItem *item )
{
if
(
!
item
)
return
;
if
(
item
->
i_id
==
i_cached_id
)
i_cached_id
=
-
1
;
i_cached_input_id
=
-
1
;
if
(
currentItem
==
item
)
{
currentItem
=
NULL
;
emit
currentChanged
(
QModelIndex
()
);
}
if
(
item
->
parentItem
)
item
->
parentItem
->
removeChild
(
item
);
if
(
item
->
parentItem
)
{
int
i
=
item
->
parentItem
->
children
.
indexOf
(
item
);
beginRemoveRows
(
index
(
item
->
parentItem
,
0
),
i
,
i
);
item
->
parentItem
->
children
.
removeAt
(
i
);
delete
item
;
endRemoveRows
();
}
else
delete
item
;
if
(
item
==
rootItem
)
...
...
@@ -862,11 +868,9 @@ void PLModel::doDeleteItem( PLItem *item, QModelIndexList *fullList )
else
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
PL_UNLOCK
;
/* And finally, remove it from the tree */
int
itemIndex
=
item
->
parentItem
->
children
.
indexOf
(
item
);
beginRemoveRows
(
index
(
item
->
parentItem
,
0
),
itemIndex
,
itemIndex
);
removeItem
(
item
);
endRemoveRows
();
}
/******* Volume III: Sorting and searching ********/
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
0132bb5d
...
...
@@ -151,12 +151,12 @@ private:
void
recurseDelete
(
QList
<
PLItem
*>
children
,
QModelIndexList
*
fullList
);
void
doDeleteItem
(
PLItem
*
item
,
QModelIndexList
*
fullList
);
void
updateTreeItem
(
PLItem
*
);
void
removeItem
(
PLItem
*
);
void
takeItem
(
PLItem
*
);
//will not delete item
void
insertChildren
(
PLItem
*
node
,
QList
<
PLItem
*>&
items
,
int
i_pos
);
void
dropAppendCopy
(
QByteArray
&
data
,
PLItem
*
target
);
void
dropMove
(
QByteArray
&
data
,
PLItem
*
target
,
int
new_pos
);
/* The following actions will not signal the view! */
void
removeItem
(
PLItem
*
);
void
updateChildren
(
PLItem
*
);
void
updateChildren
(
playlist_item_t
*
,
PLItem
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment