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!)
ProcessPlugins called 3 times in a row - a bug?
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="Vic" data-source="post: 10290"><p>Hi,</p><p></p><p>I'm currently checking out the MediaPortal code to get a hang of it and see if I can contribute with anything.</p><p></p><p>During my debugging session I noticed that the HomeWindow plugin calls ProcessPlugins three times in a row. It seemed to do exactly the same operations all three times as far as I could see. This potentially slows down startup of MediaPortal.</p><p></p><p>Look at line 92 in home\home.cs:</p><p></p><p> ProcessPlugins(ref plugins);</p><p> ProcessPlugins(ref plugins);</p><p> ProcessPlugins(ref plugins);</p><p></p><p></p><p>And a sidenote:</p><p>The method also uses "ref" for no particular reason. The "ref" keyword should only be used when you modify the supplied variable in the method that is being called and want to use the result in the calling method. This usually makes no sense when passing in an object, since it means that you overwrite the object reference with a reference to another object. In C# objects are always passed by reference and not by value.</p><p></p><p>Hope this clears things up.</p><p></p><p>Thanks for a great product! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Vic, post: 10290"] Hi, I'm currently checking out the MediaPortal code to get a hang of it and see if I can contribute with anything. During my debugging session I noticed that the HomeWindow plugin calls ProcessPlugins three times in a row. It seemed to do exactly the same operations all three times as far as I could see. This potentially slows down startup of MediaPortal. Look at line 92 in home\home.cs: ProcessPlugins(ref plugins); ProcessPlugins(ref plugins); ProcessPlugins(ref plugins); And a sidenote: The method also uses "ref" for no particular reason. The "ref" keyword should only be used when you modify the supplied variable in the method that is being called and want to use the result in the calling method. This usually makes no sense when passing in an object, since it means that you overwrite the object reference with a reference to another object. In C# objects are always passed by reference and not by value. Hope this clears things up. Thanks for a great product! :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
ProcessPlugins called 3 times in a row - a bug?
Contact us
RSS
Top
Bottom