removed a mem-leak

This commit is contained in:
Erik Faye-Lund 2008-02-19 00:47:19 +00:00
parent f49cc1ab73
commit 18f3415ae7
3 changed files with 8 additions and 1 deletions

View File

@ -241,7 +241,7 @@ int _tmain(int argc, _TCHAR* argv[])
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
/* _CrtSetBreakAlloc(68); */ // _CrtSetBreakAlloc(137);
#endif #endif
HINSTANCE hInstance = GetModuleHandle(NULL); HINSTANCE hInstance = GetModuleHandle(NULL);

View File

@ -6,6 +6,12 @@
using namespace sync; using namespace sync;
Data::~Data()
{
for (size_t i = 0; i < actualTracks.size(); ++i)
delete actualTracks[i];
}
size_t Data::getTrackIndex(const std::basic_string<TCHAR> &name) size_t Data::getTrackIndex(const std::basic_string<TCHAR> &name)
{ {
TrackContainer::iterator iter = tracks.find(name); TrackContainer::iterator iter = tracks.find(name);

View File

@ -20,6 +20,7 @@ namespace sync
class Data class Data
{ {
public: public:
~Data();
size_t getTrackIndex(const std::basic_string<TCHAR> &name); size_t getTrackIndex(const std::basic_string<TCHAR> &name);
Track &getTrack(const std::basic_string<TCHAR> &name); Track &getTrack(const std::basic_string<TCHAR> &name);