#include "StdAfx.h" #include "Error_m.h" #include <stdlib.h> p4dn::Error::Error( ::Error* e) { _err = e; _requiresFree = false; _Disposed = false; } p4dn::Error::Error( void ) { _err = new ::Error(); _requiresFree = true; _Disposed = false; } p4dn::Error::~Error( void ) { CleanUp(); } void p4dn::Error::Dispose() { System::GC::SuppressFinalize(this); _Disposed = true; CleanUp(); } void p4dn::Error::CleanUp() { if (_requiresFree && _err != NULL ) delete _err; _err = NULL; _requiresFree = false; } ::Error* p4dn::Error::get_InternalError() { // Silly programer called Dispose() too early // I will be nice to them and reset the object if(_Disposed) { _err = new ::Error(); _Disposed = false; System::GC::ReRegisterForFinalize(this); } return _err; } void p4dn::Error::Clear() { get_InternalError()->Clear(); } bool p4dn::Error::Test() { return get_InternalError()->GetSeverity() == E_INFO; } bool p4dn::Error::IsInfo() { return get_InternalError()->GetSeverity() == E_INFO; } bool p4dn::Error::IsWarning() { return get_InternalError()->GetSeverity() == E_WARN; } bool p4dn::Error::IsFatal() { return get_InternalError()->GetSeverity() == E_FATAL; } System::String* p4dn::Error::Fmt() { ::StrBuf buf; get_InternalError()->Fmt( &buf ); System::String* temp = buf.Text(); return temp->Trim(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 5826 | Shawn Hladky | PerforceDotNet is now obsolete | ||
#3 | 4643 | Shawn Hladky | Clean-up some more memory issues | ||
#2 | 4545 | Shawn Hladky |
Several Fixes: Updated solution to Visual Studio 2003 Implemented InputData Implemented OutPutBinary Changed ClientAPI and Error objects to implement the IDisposable interface to improve Garbage Collection Changed header files so you don't need to add #pragma once to the p4 api headers. Refactored the ClientUserDelagate class Fixed a few minor memory leaks |
||
#1 | 4328 | Shawn Hladky | Branching from //guest/jacob_gladish/PerforceDotNet/... | ||
//guest/jacob_gladish/PerforceDotNet/p4dn/Error_m.cpp | |||||
#1 | 3787 | Jacob Gladish | initial code submission |