Merge branch 'master' into Simple_SMS
* master: Fix some segfaults.
This commit is contained in:
@@ -245,11 +245,6 @@ DRAMSys::~DRAMSys()
|
||||
|
||||
delete arbiter;
|
||||
|
||||
for (auto controller : controllers)
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
for (auto dram : drams)
|
||||
{
|
||||
delete dram;
|
||||
@@ -264,6 +259,11 @@ DRAMSys::~DRAMSys()
|
||||
{
|
||||
delete tlmChecker;
|
||||
}
|
||||
|
||||
for (auto controller : controllers)
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
}
|
||||
|
||||
void DRAMSys::report(string message)
|
||||
|
||||
@@ -78,15 +78,15 @@ int sc_main(int argc, char **argv)
|
||||
std::vector<StlPlayer*> players;
|
||||
|
||||
// Instantiate DRAMSys:
|
||||
DRAMSys dramSys("DRAMSys", SimulationXML, resources);
|
||||
DRAMSys *dramSys = new DRAMSys("DRAMSys", SimulationXML, resources);
|
||||
|
||||
// Instantiate STL Players:
|
||||
traceSetup(SimulationXML, resources, &players);
|
||||
traceSetup *ts = new traceSetup(SimulationXML, resources, &players);
|
||||
|
||||
// Bind STL Players with DRAMSys:
|
||||
for(auto& p : players)
|
||||
{
|
||||
p->iSocket.bind(dramSys.tSocket);
|
||||
p->iSocket.bind(dramSys->tSocket);
|
||||
}
|
||||
|
||||
// Store the starting of the simulation in wallclock time:
|
||||
@@ -105,5 +105,8 @@ int sc_main(int argc, char **argv)
|
||||
double elapsed_secs = double(clock() - simStartTime) / CLOCKS_PER_SEC;
|
||||
cout << "Simulation took " + to_string(elapsed_secs) + " seconds" << endl;
|
||||
|
||||
delete dramSys;
|
||||
delete ts;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user