2007-12-11, 19:20
In some circumstances (which are unknown for me, but it happens for me though), XBMC crashes when a music library is selected. An assertion fails. I removed the assertion and replaced it with an if-construction, but maybe someone can trace down the real problem, what I'm not capable of because I lack the knowledge of how the system works. Anyway, you may want to include this patch in the SVN or apply it only when you have the same problem.
Code:
Index: guilib/StdString.h
===================================================================
--- guilib/StdString.h (revision 10954)
+++ guilib/StdString.h (working copy)
@@ -872,21 +872,21 @@
SSCodeCvt::result res = SSCodeCvt::ok;
const SSCodeCvt& conv = SS_USE_FACET(loc, SSCodeCvt);
SSCodeCvt::state_type st= { 0 };
- res = conv.in(st,
- pSrcA, pSrcA + nSrc, pNextSrcA,
- pDstW, pDstW + nDst, pNextDstW);
+ res = conv.in(st,pSrcA, pSrcA + nSrc, pNextSrcA,pDstW, pDstW + nDst, pNextDstW);
- ASSERT(SSCodeCvt::ok == res);
- ASSERT(SSCodeCvt::error != res);
- ASSERT(pNextDstW >= pDstW);
- ASSERT(pNextSrcA >= pSrcA);
+ if (SSCodeCvt::ok == res)
+ {
+ ASSERT(SSCodeCvt::error != res);
+ ASSERT(pNextDstW >= pDstW);
+ ASSERT(pNextSrcA >= pSrcA);
- // Null terminate the converted string
+ // Null terminate the converted string
- if ( pNextDstW - pDstW > nDst )
- *(pDstW + nDst) = '\0';
- else
- *pNextDstW = '\0';
+ if ( pNextDstW - pDstW > nDst )
+ *(pDstW + nDst) = '\0';
+ else
+ *pNextDstW = '\0';
+ }
}
return pDstW;
}