void CWedApp::OnAppAbout() { CAboutDlg aboutDlg; // Declare the variables needed #ifdef _DEBUG static CMemoryState oldMemState3, newMemState3, diffMemState3; #endif #ifdef _DEBUG oldMemState3.Checkpoint(); #endif aboutDlg.DoModal(); #ifdef _DEBUG newMemState3.Checkpoint(); if( diffMemState3.Difference( oldMemState3, newMemState3 ) ) { oldMemState3.DumpAllObjectsSince(); //P2N("CDialog Memory leaked!\r\n"); //TRACE( "CDialog Memory leaked!\n" ); } #endif }
CMainFrame::CMainFrame() { #ifdef _DEBUG oldMemState.Checkpoint(); #endif }
int CMLeakView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here LOGFONT lf; memset(&lf,0,sizeof(LOGFONT)); lf.lfHeight = 50; lf.lfWeight=FW_NORMAL; lf.lfEscapement=0; lf.lfOrientation=0; lf.lfItalic=false; lf.lfUnderline = false; lf.lfStrikeOut = false; lf.lfCharSet=ANSI_CHARSET; lf.lfPitchAndFamily=34; //Arial NFont.CreateFontIndirect(&lf); #ifdef _DEBUG oldMemState.Checkpoint(); #endif return 0; }
void CMLeakView::OnDraw(CDC* pDC) { CMLeakDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); CFont* pOFont; pOFont = pDC->SelectObject(&NFont); pDC->TextOut(20, 200, pDoc->myCString); pDC->SelectObject(pOFont); DeleteObject(pOFont); #ifdef _DEBUG newMemState.Checkpoint(); if (diffMemState.Difference(oldMemState,newMemState)) { TRACE("\n\nDifference between start and finish!"); newMemState.DumpStatistics(); } #endif }
CWedApp::CWedApp() { #ifdef _DEBUG oldMemState.Checkpoint(); currentedit = NULL; wantcaret = FALSE; #endif }
CMainFrame::~CMainFrame() { #ifdef _DEBUG newMemState.Checkpoint(); if( diffMemState.Difference( oldMemState, newMemState ) ) { //P2N("Mainfrm Memory leaked!\r\n"); //TRACE("Mainframe Diff dump\n"); //diffMemState.DumpAllObjectsSince(); //TRACE( "Memory leaked!\n" ); } #endif }
CWedApp::~CWedApp() { #ifdef _DEBUG newMemState.Checkpoint(); if( diffMemState.Difference( oldMemState, newMemState ) ) { //diffMemState.DumpAllObjectsSince(); //P2N("Memory leaked!\r\n"); //TRACE( "Memory leaked!\n" ); } #endif }
CWedDoc::CWedDoc() { #ifdef _DEBUG oldMemState.Checkpoint(); #endif inited = notfullundo = 0; unix = readonly = 0; origlines = undopos = undoorig = 0; spaceify = 0; // Historical default maxcol = 80; comment = "//"; memset(&docstat, 0 , sizeof(docstat)); memset(&docstat2, 0 , sizeof(docstat2)); }
static int psx_handler(request_rec *r) { #ifdef _DWINMEM static CMemoryState myMs; myMs.Checkpoint(); #endif #ifdef APACHE2 if (!r->handler || (strcmp("smx-parsed",r->handler))) return DECLINED; #endif qEnvApache *renv = get_psx_req_env(r); qEnvApacheServer *senv = get_psx_srv_env(r); if (!renv) return DECLINED; if (r->status == HTTP_MOVED_TEMPORARILY) { renv->Done(); return r->status; } if (r->filename && *r->filename) { qStr *pIn = NULL; qStrBuf *badUrl = NULL; r->status = HTTP_OK; FILE *fp=NULL; qStrFileI inT; if (r->filename && *r->filename && (fp = fopen(r->filename,"rb"))) { inT.SetFile(fp, true); pIn = &inT; } else { if (senv->GetBadMacro() && *senv->GetBadMacro()) { badUrl = new qStrBuf(senv->GetBadMacro()); pIn = badUrl; } else { renv->Done(); return HTTP_NOT_FOUND; } } #ifdef APACHE2 renv->GetCtx()->MapObj((const char **)&r->user, "client-authname"); #else renv->GetCtx()->MapObj((const char **)&r->connection->user, "client-authname"); #endif if (r->prev && r->prev->unparsed_uri) { renv->GetCtx()->MapObj((const char **)&r->prev->unparsed_uri, "redirect-url"); } else { renv->GetCtx()->MapObj(CStr::Null, "redirect-url"); } bool noMagic = senv->GetNoMagic(); int code = 0; qStr *out = renv; qStrBuf wrapTmp; if (senv->GetWrapMacro()) { out = &wrapTmp; } if (senv->GetPageMacro() && !badUrl && fp) { bool ok = noMagic; if (!ok) { char c=fgetc(fp); ok = (c == '%'); ungetc(c, fp); } if (ok) { qStrBuf pageTmp(senv->GetPageMacro()); qStrBuf outTmp; renv->GetCtx()->ParseTry(&pageTmp, &outTmp); outTmp.Trim(); if (!outTmp.IsEmpty()) renv->PutS(outTmp); } } try { if (badUrl || noMagic) renv->GetCtx()->ParseTry(pIn, renv); else { if (!renv->GetCtx()->ParseMagic(pIn, renv, false)) { code = DECLINED; } } } catch (...) { try { renv->PutS("Unexpected error."); renv->Done(); r->status = 500; return 500; } catch (...) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, AP2STATUS r, "PSX : Unexpected error, recovery impossible, possible memory leak."); r->status = 500; return 500; } } if (senv->GetWrapMacro()) { renv->GetCtx()->MapObj(&wrapTmp, "page"); qStrBuf pageTmp(senv->GetWrapMacro()); renv->GetCtx()->ParseTry(&pageTmp, renv); } if (badUrl) delete badUrl; if (code == DECLINED) return code; code = r->status; if (badUrl || renv->GetContentLength() > 0 || code > 200) { code = renv->FinishReq(false); } else { code = HTTP_NOT_FOUND; } renv->Done(); #ifdef _DWINMEM myMs.DumpAllObjectsSince(); #endif return code; } else renv->Done(); return DECLINED; }