From 8ccc524de8a65c2708655bc76fb9ec13bd058f78 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 24 Nov 2015 13:31:42 +0100 Subject: [PATCH] [surf] Move storageCreatedCallbacks outside of constructor --- src/surf/storage_interface.cpp | 2 -- src/surf/storage_n11.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 073a6efc91..4720735639 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -61,7 +61,6 @@ Storage::Storage(Model *model, const char *name, xbt_dict_t props, , p_typeId(xbt_strdup(type_id)) , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL)) { - surf_callback_emit(storageCreatedCallbacks, this); p_content = parseContent(content_name); setState(SURF_RESOURCE_ON); } @@ -75,7 +74,6 @@ Storage::Storage(Model *model, const char *name, xbt_dict_t props, , m_size(size), m_usedSize(0) , p_typeId(xbt_strdup(type_id)) , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL)) { - surf_callback_emit(storageCreatedCallbacks, this); p_content = parseContent(content_name); p_attach = xbt_strdup(attach); setState(SURF_RESOURCE_ON); diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index a2614f817d..01769e102b 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -252,7 +252,7 @@ Storage *StorageN11Model::createStorage(const char* id, const char* type_id, Storage *storage = new StorageN11(this, id, properties, p_maxminSystem, Bread, Bwrite, Bconnection, type_id, (char *)content_name, xbt_strdup(content_type), storage_type->size, (char *) attach); - + surf_callback_emit(storageCreatedCallbacks, storage); xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage); XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tproperties '%p'\n\t\tBread '%f'\n", -- 2.20.1