Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I destroy this vector?

8 views
Skip to first unread message

dkat

unread,
Dec 11, 2008, 5:14:37 PM12/11/08
to
I have never had a problem with a progam taking care of destroying
global allocated memory stores before but now that I have added a
keyboard handler I am and I can only assume it is this one variable.
How do I destroy it myself? (I am deleting the keyboard variable
without any indication of it being the problem). Thank you for your
time. D Kat


class Trial
{
public:
AnsiString WaveFile; // audio stimulus wave filename
AnsiString ButtonResponse; // Subject's response if needed
AnsiString RT; // Stimulus time or response time from beginning of
stimulus display
};


vector<Trial> TrialList;

//for loop of i
TrialList.push_back(TempTrial); // add a trial element
TrialList[i].WaveFile=TempString.SubString(1,p=TempString.Pos
(",")-1); // get audio filename
TrialList[i].ButtonResponse = "0 ";
TrialList[i].RT = "0 ";

//---------------------------------------------------------------------------
void TMainForm::HWClose(void)
{
if(!HWInitFlag)return;
DXKeyboardInput->FlushKeyboardData();
// DXKeyboardInput->SetActiveDevices(true,true,true); //keyboard
responses(mouse,key,joy)
DXKeyboardInput->SetKeyboardExclusive(false);
delete DXSound;//SAFEDELETE(DXSound);
delete DXKeyboardInput;//SAFEDELETE(DXKeyboardInput);
ShowCursor(true);
HWInitFlag = false;
return;
}

dkat

unread,
Dec 11, 2008, 6:21:27 PM12/11/08
to
On Dec 11, 5:14 pm, dkat <dkats...@gmail.com> wrote:

Got

TrailList.clear();

to compile just fine but that does not seem to be the problem. The
application gets all the way through to the ~mainform() destruct and
then hangs at

vector.h

~vector ()
{
__destroy(__start, __finish);
__value_alloc_type(__end_of_storage).deallocate
(__start,__end_of_storage.data()-__start);
}

with this error

'Access fiolation at address 0040976A. Read of address FEEEFEF6.
Process stopped. Use Step or Run to Continue.

0 new messages