Permalink
Browse files

FIX: Crash when generating thumbnails (at least with mysql on Windows)

  • Loading branch information...
1 parent 0be99e9 commit a5dee6a3017d62a9d8276a2271100bc9c978b248 @koying committed Oct 31, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 xbmc/video/VideoThumbLoader.cpp
View
11 xbmc/video/VideoThumbLoader.cpp
@@ -408,7 +408,16 @@ void CVideoThumbLoader::OnJobComplete(unsigned int jobID, bool success, CJob* jo
CVideoInfoTag* info = loader->m_item.GetVideoInfoTag();
if (loader->m_thumb && info->m_iDbId > 0 && !info->m_type.empty())
- m_database->SetArtForItem(info->m_iDbId, info->m_type, "thumb", loader->m_item.GetArt("thumb"));
+ {
+ // This runs in a different thread than the CVideoThumbLoader object.
+ CVideoDatabase db;
+ if (db.Open())
+ {
+ db.SetArtForItem(info->m_iDbId, info->m_type, "thumb", loader->m_item.GetArt("thumb"));
+ db.Close();
+ }
+
+ }
if (m_pStreamDetailsObs)
m_pStreamDetailsObs->OnStreamDetails(info->m_streamDetails, info->m_strFileNameAndPath, info->m_iFileId);

0 comments on commit a5dee6a

Please sign in to comment.