Hi
I am facing some memory leaks in windowmediaplayer after disposing it.
Following is the code
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
AxWMPLib.AxWindowsMediaPlayer m = new AxWMPLib.AxWindowsMediaPlayer();
private void start_Click(object sender, EventArgs e)
{
this.Controls.Add(m);
m.Location = new System.Drawing.Point(1, 1);
m.Height = 130;
m.Width = 150;
m.URL = @"C:\Users\Public\Videos\Sample Videos\Bear.wmv";
}
private void stop_Click(object sender, EventArgs e)
{
m.URL = null;
m.close();
m.Dispose();
}
}
On clicking stop, it is still keeping the following in the memory
System.Windows.Forms.AxHost.ConnectionPointCookie
AxWMPLib.AxWindowsMediaPlayerEventMulticaster
Please Help
Thanks
Loading
Suthish NairPosted Feb 19, 2011, 12:24 PM
This not a good way, use Process.Kill
Ibrahim ErsoyPosted Feb 19, 2011, 9:11 AM
Can you please talk about what does your application do?