Encoder - Removal??

B

Bsmengen

I have a C# application that uses Windows Media Encoder 9 to stream multiple
programs. For each new program, I create a new instance of WMEncoder. After
successfully stopping the Encoder, what is the proper way to remove it for
Garbage Collection? Currently I set Encoder = null and Garbage Collection
should remove it from what I understand.

I have not been able to get rid of the new Encoder instances and this
creates a memory leak. Please help.

Is there any good documentation out there dealing with Interop.WMEncoderLib?
I haven't found any yet or good C# code examples dealing with this matter.

Is there a function of Dispose or something similar for the Encoder? I need
to figure out the correct way to release all the resources of the Encoder.

Thanks,
Bob



Bob
 
C

Chris Dunaway

I have a C# application that uses Windows Media Encoder 9 to stream multiple
programs. For each new program, I create a new instance of WMEncoder. After
successfully stopping the Encoder, what is the proper way to remove it for
Garbage Collection? Currently I set Encoder = null and Garbage Collection
should remove it from what I understand.

I have not been able to get rid of the new Encoder instances and this
creates a memory leak. Please help.

Is there any good documentation out there dealing with Interop.WMEncoderLib?
I haven't found any yet or good C# code examples dealing with this matter.

Is there a function of Dispose or something similar for the Encoder? I need
to figure out the correct way to release all the resources of the Encoder.

Thanks,
Bob

Bob

Is it a COM component? If so, you should probably call the
Marshal.ReleaseComObject method on it.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top