home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Exception in MediaPortal.Configuration
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Snoopy87" data-source="post: 1012466" data-attributes="member: 128461"><p>Hi,</p><p> </p><p>today I tried to compile and run MediaPortal, after setting up my development machine.</p><p> </p><p>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:</p><p> </p><p>[CODE] private void DoRun()</p><p> {</p><p> string oldInfo = null;</p><p> frm = new SplashForm();</p><p> frm.SetVersion(Version);</p><p> frm.Show();</p><p> frm.Update();</p><p> frm.FadeIn();</p><p> while (!stopRequested && (frm.Focused || _allowOverlay)) //run until stop of splashscreen is requested</p><p> {</p><p> if (_allowOverlay == true && _hintForm != null) // Allow other Windows to Overlay the splashscreen</p><p> {</p><p> if (_hintForm.Visible) // prepare everything to let the Outdated skin message appear</p><p> {</p><p> if (frm.Focused)</p><p> {</p><p> frm.TopMost = false;</p><p> </p><p> // EXCEPTION: _hintForm was created in a different thread, so you can't access _hintForm from this thread</p><p> _hintForm.TopMost = true;</p><p> _hintForm.BringToFront();</p><p> }</p><p> }</p><p> else</p><p> {</p><p> _allowOverlay = false;</p><p> frm.TopMost = true;</p><p> frm.BringToFront();</p><p> }</p><p> }</p><p> if (oldInfo != info)</p><p> {</p><p> frm.SetInformation(info);</p><p> oldInfo = info;</p><p> }</p><p> Thread.Sleep(25);</p><p> }</p><p> frm.FadeOut();</p><p> frm.Close(); //closes, and disposes the form</p><p> frm = null;</p><p> }[/CODE]</p><p> </p><p>So I thought it would be fixed with the following code:</p><p> </p><p>[CODE]_hintForm.Invoke(new System.Action(() =></p><p> {</p><p> _hintForm.TopMost = true;</p><p> _hintForm.BringToFront();</p><p> })); [/CODE]</p><p> </p><p>But then I get an ObjectDispose exception, because _hintForm were already disposed...</p><p> </p><p> </p><p>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...</p><p> </p><p>Regards,</p><p>Sascha</p><p> </p><p> </p><p>EDIT:</p><p> </p><p>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.</p><p> </p><p>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.</p></blockquote><p></p>
[QUOTE="Snoopy87, post: 1012466, member: 128461"] 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; }[/CODE] So I thought it would be fixed with the following code: [CODE]_hintForm.Invoke(new System.Action(() => { _hintForm.TopMost = true; _hintForm.BringToFront(); })); [/CODE] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Exception in MediaPortal.Configuration
Contact us
RSS
Top
Bottom