memory leak in C#?

  • Thread starter Thread starter bobo
  • Start date Start date
B

bobo

GraphicsPath p=new GraphicsPath();
//p.AddLine(p1,p2);
//p.Widen(pen);
p.Dispose();

this code runs ok.

but if I uncomment the two lines above. the program finally crashes out of
memory? can somebody tell me why?

thank you.
 
I don't get this behaviour.
My code runs fine:
GraphicsPath gPath = new GraphicsPath();
gPath.AddLine(10,10,100,100);
gPath.Widen(new Pen(Color.Red, 2));
gPath.Dispose();

Is there not something else that could be causing the app to crash?
What about the possibility of a infinite loop somewhere else?


Simon
 

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

Similar Threads

Memory leak using pInvoke 3
Marshal.PtrToStringAnsi() Memory Leak? Options 1
Overloading in generic interfaces 23
Image from memory 1
Images from memory 1
C# Memory Leaks 5
Memory leak in C# 8
Memory Leaks in C# 5

Back
Top