Index: mediaportal/Core/guilib/GUIImage.cs =================================================================== --- mediaportal/Core/guilib/GUIImage.cs (revision 26459) +++ mediaportal/Core/guilib/GUIImage.cs (working copy) @@ -879,25 +879,33 @@ /// /// Free the DirectX resources needed for rendering this GUIImage. /// - [MethodImpl(MethodImplOptions.Synchronized)] - public override void Dispose() - { - - if (logtextures) - { - Log.Info("GUIImage:Dispose:{0} {1}", _debugCachedTextureFileName, _debugGuid); - //Log.Info("stacktrace:{0}", _debugCachedTextureFileName, _debugGuid); - } + public override void Dispose() { + lock (GUIGraphicsContext.RenderLock) { - //base.Dispose(); // breaks fade in/out animations-. - _allocated = false; - UnsubscribeOnPropertyChanged(); - UnsubscribeAndReleaseListTextures(); - Cleanup(); + lock (this) { - _memoryImage.SafeDispose(); - _memoryImageTexture = null; - //_debugDisposed = true; + //base.Dispose(); // breaks fade in/out animations-. + + if (!_allocated) { + return; + } + + if (logtextures) { + Log.Info("GUIImage:Dispose:{0} {1}", _debugCachedTextureFileName, _debugGuid); + //Log.Info("stacktrace:{0}", _debugCachedTextureFileName, _debugGuid); + } + + _allocated = false; + UnsubscribeOnPropertyChanged(); + UnsubscribeAndReleaseListTextures(); + Cleanup(); + + _memoryImage.SafeDispose(); + _memoryImageTexture = null; + + } + } + //_debugDisposed = true; } private void UnsubscribeOnPropertyChanged()