S
Sunit Joshi
Hello All
I have an abstract class C1 with this:
public abstract class C1
{
protected bool m_Dirty;
protected override void Dispose(bool disposing)
{
if(m_Dirty)
WriteOuput();
base.Dispose (disposing);
}
protected void finalize()
{
Dispose(false);
GC.SuppressFinalize(this);
}
public abstract void WriteOuput();
}
Then I have a derived class C2 with this:
public class C2: C1
{
public override void WriteOuput()
{
if(m_Dirty)
{
try
{
m_Log.WriteXml(m_InitialData);
}
catch
{
//Ignore error if file is not valid
}
m_Dirty = false;
}
}
}
I use C2 in my code, but I don't see the parent dispose being called
since the output is never written...Am'I missing something here..??
thanks
Sunit
(e-mail address removed)
I have an abstract class C1 with this:
public abstract class C1
{
protected bool m_Dirty;
protected override void Dispose(bool disposing)
{
if(m_Dirty)
WriteOuput();
base.Dispose (disposing);
}
protected void finalize()
{
Dispose(false);
GC.SuppressFinalize(this);
}
public abstract void WriteOuput();
}
Then I have a derived class C2 with this:
public class C2: C1
{
public override void WriteOuput()
{
if(m_Dirty)
{
try
{
m_Log.WriteXml(m_InitialData);
}
catch
{
//Ignore error if file is not valid
}
m_Dirty = false;
}
}
}
I use C2 in my code, but I don't see the parent dispose being called
since the output is never written...Am'I missing something here..??
thanks
Sunit
(e-mail address removed)