yes I didn't take care of that.sorry Muhammad Adel
"The secret to creativity is knowing how to hide your sources". Einstein ----- Original Message ----- From: "Chad M. Gross" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 02, 2004 5:16 PM Subject: Re: [ADVANCED-DOTNET] Exceptions in Constructors > Muhammad, you didn't read my note close enough. The _myIntPointer is a > private field member of Class1 so you obviously do not have access to it > as you are showing below. Take another look at my original note. > > Chad > > >you can use _finally (C++) or finally (C#) blocks to make sure that no > >memory leaks happen.see the > >following code: > > > >Class1* c = NULL; > > > >try { > > c = new Class1(); > > c.DoSomething(); > >} > >catch {char* msg) {} > >finally > >{ > > if (c==Null) > > { > > if ( _myIntPointer!=NULL) > > { > > delete _myIntPointer; > > } > > } > >} > > =================================== > This list is hosted by DevelopMentor® http://www.develop.com > Some .NET courses you may be interested in: > > NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles > http://www.develop.com/courses/gaspdotnetls > > View archives and manage your subscription(s) at http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com