| | |
Memory leaks!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 390
Reputation:
Solved Threads: 39
I don't know what's going on here...but I always seem to get 2 leaks of 40bytes each consisting of FF FF FF FF.... Even with all the code commented out, I still seem to get these leaks. I'm running Visual Studio on Vista SP1, so perhaps a combatibility issue? Or maybe I'm just forgetting my DMA from the years class. Here's the code:
all that is called in main.cpp is the testcode() function. I commented out any time dma is used (in testcode() ) and the stupid memory leaks still show up. I'm getting frustrated!! Any help would be appreciated!
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; #include "funcs.h" // Turning on the heap checker bool HashMake(int *&iHash, int iSize) { bool bReturn = true; if (iSize >= 1) { HashFree(iHash, iSize); iHash = new (nothrow) int[iSize]; for (int i = 0; i < iSize; i++) iHash[i] = -1; } else bReturn = false; return bReturn; } void HashFree(int *&iHash, int iSize) { delete [] iHash; iHash = 0; return; } void TestCode() { _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); /*int const SIZE = 10; int * iHash(NULL); HashMake(iHash, SIZE); for (int i = 0; i < SIZE; i++) cout << iHash[i] << endl; */ cin.get(); // HashFree(iHash, SIZE); }
all that is called in main.cpp is the testcode() function. I commented out any time dma is used (in testcode() ) and the stupid memory leaks still show up. I'm getting frustrated!! Any help would be appreciated!
![]() |
Similar Threads
- Memory Leaks (C++)
- Memory leaks through stringstream.str() (C++)
- Memory Leaks in Java (Java)
- The definiton of "Memory leaks" (C++)
- Dynamic memory allocation homework (C++)
Other Threads in the C++ Forum
- Previous Thread: Game Of Life help? Ive done most of it
- Next Thread: Initialise array of objects in a class
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets





