i'm having a problem with destroying datarow objects. The methode
DataTable.NewRow() returns an empty row for the table but does not
insert the row into the table. when the row is member of the table there
is no problem at deleting the row but my problem is to destroy the row
without inserting it into the table. is the row maybe part of another
collection in the table than the "Rows" collection which prevent that
the garbage collector is collecting the row.

        public class RowSample
        {
                DataRow m_DataRow = null;

                public RowSample(DataTable dt)
                {
                        m_DataRow = dt.NewRow();

                        // without these line there is a memory leak
                        dt.Rows.Add(m_DataRow);
                }

                ~RowSample()
                {
                        m_DataRow.Delete();
 
                        m_DataRow = null;
                }
        }

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to