Add some locking to accesing PlaylistItems in these two cases as suggested by

Stephan.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35348 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-01-30 18:42:46 +00:00
parent 6a5cf0a1f2
commit 382a4b129a

View File

@ -487,6 +487,7 @@ MainWin::MessageReceived(BMessage* msg)
case 8: case 8:
{ {
if (msg->what == B_GET_PROPERTY) { if (msg->what == B_GET_PROPERTY) {
BAutolock _(fPlaylist);
const PlaylistItem* item = fController->Item(); const PlaylistItem* item = fController->Item();
if (item == NULL) { if (item == NULL) {
result = B_NO_INIT; result = B_NO_INIT;
@ -2024,6 +2025,7 @@ MainWin::_ShowIfNeeded()
void void
MainWin::_SetFileAttributes() MainWin::_SetFileAttributes()
{ {
BAutolock locker(fPlaylist);
const FilePlaylistItem* item const FilePlaylistItem* item
= dynamic_cast<const FilePlaylistItem*>(fController->Item()); = dynamic_cast<const FilePlaylistItem*>(fController->Item());
if (item == NULL) if (item == NULL)
@ -2034,6 +2036,8 @@ MainWin::_SetFileAttributes()
if (node.InitCheck()) if (node.InitCheck())
return; return;
locker.Unlock();
// write duration // write duration
attr_info info; attr_info info;