Exception in MediaPortal.Configuration (1 Viewer)

Snoopy87

Portal Pro
August 12, 2012
470
167
Home Country
Germany Germany
Hi,

today I tried to compile and run MediaPortal, after setting up my development machine.

Compiling works great but I'm unable to start MediaPortal (which firstly starts MediaPortal.Configuration), because there is an exception in the ConfigSplashScreen.cs of MediaPortal.Configuration:

Code:
 private void DoRun()
	{
	  string oldInfo = null;
	  frm = new SplashForm();
	  frm.SetVersion(Version);
	  frm.Show();
	  frm.Update();
	  frm.FadeIn();
	  while (!stopRequested && (frm.Focused || _allowOverlay)) //run until stop of splashscreen is requested
	  {
		if (_allowOverlay == true && _hintForm != null) // Allow other Windows to Overlay the splashscreen
		{
		  if (_hintForm.Visible) // prepare everything to let the Outdated skin message appear
		  {
			if (frm.Focused)
			{
			  frm.TopMost = false;
 
			// EXCEPTION: _hintForm was created in a different thread, so you can't access _hintForm from this thread
			  _hintForm.TopMost = true;
			  _hintForm.BringToFront();
			 }
		  }
		  else
		  {
			_allowOverlay = false;
			frm.TopMost = true;
			frm.BringToFront();
		  }
		}
		if (oldInfo != info)
		{
		  frm.SetInformation(info);
		  oldInfo = info;
		}
		Thread.Sleep(25);
	  }
	  frm.FadeOut();
	  frm.Close(); //closes, and disposes the form
	  frm = null;
	}

So I thought it would be fixed with the following code:

Code:
_hintForm.Invoke(new System.Action(() =>
				  {
					  _hintForm.TopMost = true;
					  _hintForm.BringToFront();
				  }));

But then I get an ObjectDispose exception, because _hintForm were already disposed...


I don't understand both exceptions, because the file was not changed for a long time and MediaPortal 1.3, 1.4, etc. is working for all MediaPortal users without those exceptions...

Regards,
Sascha


EDIT:

Ok, I checked the whole Code and this is definetly a bug, but I don't understand, why it not happens with the installed version of MediaPortal.

The problem is, that the while-loop of DoRun() runs in a seperate thread. The _hintForm (DlgConfigMdoeHint) will be shown and closed in a different thread, so the code of DoRun() can't work, because it is always possible that _hintForm is already disposed while accessing it.
 
Last edited:

Users who are viewing this thread

Top Bottom