Ignore:
Timestamp:
Feb 6, 2017, 11:35:42 AM (7 years ago)
Author:
meunier
Message:
  • Fixed memory leaks
  • Fixed indentation in some files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/global_functions.cc

    r52 r59  
    3838#include <iostream>
    3939#include <dlfcn.h>
     40#include <signal.h>
    4041
    4142#include "schedulers.h"   // get_scheduling & run_schedule_editor
     
    326327    check_and_initialize();
    327328    sc_core::internal_sc_cycle0(duration);
     329    if (have_to_stop) {
     330        std::vector<method_process_t *>::iterator i;
     331        for (i = sc_core::method_process_list.begin(); i != sc_core::method_process_list.end(); i++) {
     332            delete *i;
     333        }
     334        std::vector<const char *>::iterator j;
     335        for (j = sc_core::allocated_names.begin(); j != sc_core::allocated_names.end(); j++) {
     336            free((char *) *j);
     337        }
     338    }
    328339}
    329340
     
    332343    check_and_initialize();
    333344    sc_core::internal_sc_cycle0(duration);
     345    if (have_to_stop) {
     346        std::vector<method_process_t *>::iterator i;
     347        for (i = sc_core::method_process_list.begin(); i != sc_core::method_process_list.end(); i++) {
     348            delete *i;
     349        }
     350        std::vector<const char *>::iterator j;
     351        for (j = sc_core::allocated_names.begin(); j != sc_core::allocated_names.end(); j++) {
     352            free((char *) *j);
     353        }
     354    }
    334355}
    335356
Note: See TracChangeset for help on using the changeset viewer.