This commit is contained in:
mterwoord_cp 2010-08-02 12:53:26 +00:00
parent 93ad7db51f
commit ed2abdb9a2
4 changed files with 21 additions and 1 deletions

View file

@ -8,7 +8,7 @@ using System.Windows.Forms;
namespace Cosmos.Debug.Common.CDebugger
{
public abstract class DebugConnector {
public abstract class DebugConnector: IDisposable {
//TODO: These should not be this way and should in fact
// be checked or better yet done by constructor arguments
// but that puts a restriction on where the sub classes
@ -103,6 +103,11 @@ namespace Cosmos.Debug.Common.CDebugger
}
}
public virtual void Dispose()
{
GC.SuppressFinalize(this);
}
protected void PacketTextSize(byte[] aPacket) {
Next(GetUInt16(aPacket, 0), PacketText);
}

View file

@ -45,6 +45,16 @@ namespace Cosmos.Debug.Common.CDebugger {
// Request first command
Next(1, PacketCommand);
}
public override void Dispose()
{
if (mStream != null)
{
mStream.Close();
mStream = null;
}
base.Dispose();
}
protected override void PacketTracePoint(byte[] aPacket) {
CmdTrace(mCurrentMsgType, GetUInt32(aPacket, 0));

View file

@ -369,6 +369,8 @@ namespace Cosmos.Debug.VSDebugEngine {
{
mProcess.Kill();
mProcess.Exited -= mProcess_Exited;
mDbgConnector.Dispose();
mDbgConnector = null;
return VSConstants.S_OK;
}
@ -394,6 +396,8 @@ namespace Cosmos.Debug.VSDebugEngine {
Trace.WriteLine(String.Format("Process Exit Code: {0}", mProcess.ExitCode));
//AD7ThreadDestroyEvent.Send(mEngine, mThread, (uint)mProcess.ExitCode);
//mCallback.OnProgramDestroy((uint)mProcess.ExitCode);
mDbgConnector.Dispose();
mDbgConnector = null;
mCallback.OnProcessExit((uint)mProcess.ExitCode);
}

View file

@ -53,6 +53,7 @@ namespace Cosmos.VS.Package
xValues.Add("DebugMode", this.GetConfigurationProperty("DebugMode", true));
xValues.Add("TraceAssemblies", this.GetConfigurationProperty("TraceAssemblies", true));
xValues.Add("BuildTarget", this.GetConfigurationProperty("BuildTarget", true));
xValues.Add("ProjectFile", Path.Combine(ProjectMgr.ProjectFolder, ProjectMgr.ProjectFile));
xInfo.bstrExe = NameValueCollectionHelper.DumpToString(xValues);