- Moderator
- #441
Super
[2015-11-26 18:53:37,501] [Error ] [RefreshWorker-LatestMediaHandler.LatestMyVideosHandler] [ERROR] - LoadSkin: Running on wrong thread - StackTrace: ' Ã System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
à System.Environment.get_StackTrace()
à MediaPortal.GUI.Library.GUIWindow.LoadSkin()
à MediaPortal.GUI.Library.GUIWindow.AllocResources()
à MediaPortal.GUI.Library.GUIWindow.DoRestoreSkin()
à MediaPortal.GUI.Library.GUIWindowManager.GetWindow(Int32 dwID, Boolean tryRestoreSkin)
à LatestMediaHandler.Utils.GetLatestsFacade(Int32 ControlID)
à LatestMediaHandler.LatestMyVideosHandler.InitFacade(Boolean OnActivate)
à LatestMediaHandler.LatestMyVideosHandler.MyVideosUpdateLatest()
à LatestMediaHandler.RefreshWorker.OnDoWork(DoWorkEventArgs e)
à System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
à System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
à System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
à System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
à System.Threading.ThreadPoolWorkQueue.Dispatch()
à System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()'
GetLatestsFacade
internal static GUIFacadeControl GetLatestsFacade(int ControlID)
{
try
{
if (GUIWindowManager.ActiveWindow > (int)GUIWindow.Window.WINDOW_INVALID)
{
GUIWindow gw = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow);
GUIControl gc = gw.GetControl(ControlID);
return gc as GUIFacadeControl;
}
}
catch (Exception ex)
{
logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow + " - " + ControlID);
logger.Error("GetLatestsFacade: " + ex);
}
return null;
}
MediaPortal.GUI.Library.GUIWindow.LoadSkin()
26-Nov-2015 18:53:35 Debug [ Utils]: Latest: [x] Pictures, [x] Music, [x][x] MyVideo, [ ][x] TVSeries, [ ][x] TV Recordings, [ ][x] MovingPictures, [ ][x] MyFilms, [ ] MvCentral
26-Nov-2015 18:53:35 Debug [ Utils]: Plugin enabled: [x] Music, [x] Pictures, [x] MyVideo, [ ] TVSeries, [ ] MovingPictures, [ ] MyFilms, [ ] MvCentral
Sorry. Dont understand the "10x "@azzuro
10x for info:
Code:26-Nov-2015 18:53:35 Debug [ Utils]: Latest: [x] Pictures, [x] Music, [x][x] MyVideo, [ ][x] TVSeries, [ ][x] TV Recordings, [ ][x] MovingPictures, [ ][x] MyFilms, [ ] MvCentral 26-Nov-2015 18:53:35 Debug [ Utils]: Plugin enabled: [x] Music, [x] Pictures, [x] MyVideo, [ ] TVSeries, [ ] MovingPictures, [ ] MyFilms, [ ] MvCentral
10х = Thanks!Sorry. Dont understand the "10x "
Wrong thread is back
if (System.Windows.Forms.Form.ActiveForm.InvokeRequired)
{
System.Windows.Forms.Form.ActiveForm.Invoke(MyVideosUpdateLatest);
}
else
{
MyVideosUpdateLatest();
}
The update will block the main thread?In LatestMediaHandler.RefreshWorker.OnDoWork() the call to LatestMediaHandler.LatestMyVideosHandler.MyVideosUpdateLatest() should switch to the main thread.
you can use
GetLatestsFacade@Sebastiii It seems to me here that it is necessary to solve and everything will be fine in all plug-ins ...Code:internal static GUIFacadeControl GetLatestsFacade(int ControlID) { try { if (GUIWindowManager.ActiveWindow > (int)GUIWindow.Window.WINDOW_INVALID) { GUIWindow gw = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow); GUIControl gc = gw.GetControl(ControlID); return gc as GUIFacadeControl; } } catch (Exception ex) { logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow + " - " + ControlID); logger.Error("GetLatestsFacade: " + ex); } return null; }
MediaPortal.GUI.Library.GUIWindow.LoadSkin()