Skip to content

Commit

Permalink
- Added missing "break:" causing crashes during clean
Browse files Browse the repository at this point in the history
  • Loading branch information
akezeke committed Feb 7, 2010
1 parent 957795d commit 8fe93ab
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions xbmc/spotinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,17 +600,16 @@ SpotifyInterface::SpotifyInterface()
m_showDisclaimer = true;
m_isShowingReconnect = false;
m_didYouMeanStr = "";
m_search = 0;
m_artistBrowse = 0;
m_albumBrowse = 0;
m_toplistArtistsBrowse = 0;
m_toplistAlbumsBrowse = 0;
m_toplistTracksBrowse = 0;
m_isBrowsingArtist = false;
m_isBrowsingAlbum = false;
m_search = 0;

m_callbacks.connection_error = &cb_connectionError;
m_callbacks.end_of_track = 0;
m_callbacks.logged_out = 0;
m_callbacks.message_to_user = 0;
m_callbacks.music_delivery = 0;
Expand Down Expand Up @@ -734,20 +733,21 @@ void SpotifyInterface::clean(bool search, bool artistbrowse, bool albumbrowse, b
{
if (search)
{
if (m_search)
sp_search_release(m_search);
m_search = 0;

//stop the thumb downloading and release the images
while (!m_searchWaitingThumbs.empty())
{
imageItemPair pair = m_searchWaitingThumbs.back();
CFileItemPtr pItem = pair.second;
sp_image_remove_load_callback(pair.first,&cb_imageLoaded, pItem.get());
sp_image_release(pair.first);
if (pair.first)
sp_image_release(pair.first);
m_searchWaitingThumbs.pop_back();
}

if (m_search)
sp_search_release(m_search);
m_search = 0;

//clear the result vectors
m_searchArtistVector.Clear();
m_searchAlbumVector.Clear();
Expand All @@ -756,10 +756,6 @@ void SpotifyInterface::clean(bool search, bool artistbrowse, bool albumbrowse, b

if (artistbrowse)
{
if (m_artistBrowse)
sp_artistbrowse_release(m_artistBrowse);
m_artistBrowse = 0;

//stop the thumb downloading and release the images
while (!m_artistWaitingThumbs.empty())
{
Expand All @@ -770,6 +766,9 @@ void SpotifyInterface::clean(bool search, bool artistbrowse, bool albumbrowse, b
m_artistWaitingThumbs.pop_back();
}

if (m_artistBrowse)
sp_artistbrowse_release(m_artistBrowse);
m_artistBrowse = 0;
m_artistBrowseStr = "";
m_browseArtistMenuVector.Clear();
m_browseArtistAlbumVector.Clear();
Expand Down Expand Up @@ -799,7 +798,6 @@ void SpotifyInterface::clean(bool search, bool artistbrowse, bool albumbrowse, b
}

m_playlistItems.Clear();

}

if (toplists)
Expand All @@ -825,10 +823,9 @@ void SpotifyInterface::clean(bool search, bool artistbrowse, bool albumbrowse, b
if (m_toplistTracksBrowse)
sp_toplistbrowse_release(m_toplistTracksBrowse);
m_toplistTracksBrowse = 0;

m_browseToplistArtistsVector.Clear();;
m_browseToplistAlbumVector.Clear();;
m_browseToplistTracksVector.Clear();;
m_browseToplistArtistsVector.Clear();
m_browseToplistAlbumVector.Clear();
m_browseToplistTracksVector.Clear();
}

if (searchthumbs)
Expand Down Expand Up @@ -1433,6 +1430,7 @@ bool SpotifyInterface::requestThumb(unsigned char *imageId, CStdString Uri, CFil
break;
case ARTISTBROWSE_ALBUM:
m_artistWaitingThumbs.push_back(pair);
break;
default:
m_searchWaitingThumbs.push_back(pair);
break;
Expand Down

0 comments on commit 8fe93ab

Please sign in to comment.