Results 1 to 4 of 4

Thread: Is it necessary to remove manually the IMediaStreamActionNotify from the stream?

  1. Default Is it necessary to remove manually the IMediaStreamActionNotify from the stream?

    Hi,

    I have found an example in which an instance of IMediaStreamActionNotify is attached to a stream. In that code there is a code snippet like this:

    public void onStreamDestroy(IMediaStream stream) {
    		IMediaStreamActionNotify actionNotify = null;
    		WMSProperties props = stream.getProperties();
    		synchronized(props)
    		{
    			actionNotify = (IMediaStreamActionNotify)stream.getProperties().get("streamActionNotifier");
    		}
    		if (actionNotify != null)
    		{
    			stream.removeClientListener(actionNotify);
    		}
    	}
    Question: if the stream is going to be destroyed, is it really necessary to manually remove this listener? I have never seen any API where this was necessary in order to prevent memory leak. In the generated javadoc that is usually referred to as server side API documentation, I haven't found any info about this. :-)

    Can you tell it to me? Thanks!

  2. #2

    Default

    Hi,

    It best practice where possible to remove any objects used in a connection prior to it shutting down. Keeping track of objects used is an important element when writing any code, regardless of language used.

    Andrew.

  3. Default

    Ok, so if we are supposed to do this, that means behind the scenes the IMediaStream object is not garbage collected along with its properties when the client is disconnected. Otherwise we could rely on the GC. Does that mean it's not safe to expect that a fresh IMediaStream's properties might contain outdated garbage data from previous cycles?

    Thanks!

  4. #4
    Join Date
    Nov 2010
    Posts
    21

    Default

    lol good question u probably can see memory leak if it doesn't. Waiting for ur finding!

Similar Threads

  1. IMediaStreamActionNotify doesn't work with iOS
    By adamkalisiak in forum Server-side Modules and Code Samples Discussion
    Replies: 5
    Last Post: 06-26-2012, 04:37 PM
  2. How to completely remove a stream?
    By jachai in forum Live Streaming and Encoder Discussion
    Replies: 5
    Last Post: 01-18-2012, 04:50 AM
  3. Is there an easy way to remove the .stream extension?
    By Bencredible in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 01-17-2012, 06:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •