NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 36 37 38 39 40 … 93 Next »
Cleaning up plugin resources

 
  • 0 Vote(s) - 0 Average
Cleaning up plugin resources
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2008-01-17, 08:16 PM
What does PVRX2 do with plugins when it exits? I've had situation when I've exited PVRX2 with my DVB-T radio plugin still playing music. The external exe doesn't get shutdown by PVRX2 (obviously) so carries on merrily producing an ever-growing mp3 buffer file. :eek:

I've tried adding a destructor to the plugin but it doesn't seem to be working - it's either not being called or the cleanup isn't being given time to complete.

What's the best way to cleanup this sort of thing?

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2008-01-17, 08:26 PM
I'm not really sure. As you've already found, .net doesnt guarantees it'll call the destructor when the app exits.

You could get the two apps to share a mutex or something similar (with the plugin acquiring it immediately and holding on to it, and the exe trying to acquire it. If it manages to acquire it, then the plugin process has gone away).
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#3
2008-01-17, 08:28 PM
I'll add a ShuttingDown event to the IEventNotification interface for the next release. I cant provide this as a patch though, since it'll break if a user doesnt get both PVRX2.exe and GBPVRPublic.dll...which complicates things if I need to provide any patches before the next release.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2008-01-17, 09:15 PM
Thanks for the replies - I'm sure the shutting down event would be useful for developers in the future and worth adding.

I was thinking of some sort of 'keep alive' mechanism although hadn't thought of a mutex.

I'll probably add the equivalent of a Remoting 'ping'. Every 60 seconds say, source just sends a dummy command which returns some (any) sort of response. Useful for both ends - the source does whatever it needs to if it gets no response and the destination does whatever it needs to if it doesn't get 'pinged' for a certain amount of time.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,726 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,293 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,421 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,857 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,735 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,027 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,931 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 4,930 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,211 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,406 2012-01-15, 08:33 PM
Last Post: imilne

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode