From 524f3927504926c56726deedfa6875299591d955 Mon Sep 17 00:00:00 2001 From: mtollari Date: Fri, 27 Jan 2017 11:53:58 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20335=20Files=20correlati=20=20=20=20=20:=20sc2=20Commento=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20:=20Aggiunto=20controllo=20sul?= =?UTF-8?q?la=20funzione=20add,=20se=20forzo=20ma=20gli=20indirizzi=20sono?= =?UTF-8?q?=20uguali=20non=20sostituisce=20il=20valore.=20(Questo=20errore?= =?UTF-8?q?=20=C3=A8=20saltato=20fuori=20con=20sc2=20-1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@23555 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/include/assoc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/assoc.cpp b/src/include/assoc.cpp index 6d7b150d0..03c33a441 100755 --- a/src/include/assoc.cpp +++ b/src/include/assoc.cpp @@ -214,11 +214,11 @@ bool TAssoc_array::add(const char* key, const TObject& obj, bool force) o->_obj = obj.dup(); return false; } - if (force) - { - if (o->_obj != NULL) - delete o->_obj; - o->_obj = obj.dup(); + if (force && o->_obj != &obj) // Tolla 2017: Aggiunto controllo sugli indirizzi, perchè c'è questo problema? + { + if (o->_obj != NULL) + delete o->_obj; + o->_obj = obj.dup(); } return true; }