A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[surf] Triggers the destructed callbacks on the full object
[simgrid.git]
/
src
/
surf
/
cpu_interface.cpp
diff --git
a/src/surf/cpu_interface.cpp
b/src/surf/cpu_interface.cpp
index
0142878
..
bd28c4d
100644
(file)
--- a/
src/surf/cpu_interface.cpp
+++ b/
src/surf/cpu_interface.cpp
@@
-191,8
+191,15
@@
Cpu::Cpu(Model *model, const char *name,
: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
-Cpu::~Cpu(){
+void Cpu::onDie()
+{
surf_callback_emit(cpuDestructedCallbacks, this);
surf_callback_emit(cpuDestructedCallbacks, this);
+ Resource::onDie();
+}
+
+Cpu::~Cpu()
+{
+ this->die();
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);