From e5afc6f029ab794d08b28a69edd2523dead8d7d7 Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sat, 1 Dec 2012 07:58:38 +0100 Subject: [PATCH] SharedPtr: Avoid double dereference when calling clear(). --- simgear/structure/SGSharedPtr.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simgear/structure/SGSharedPtr.hxx b/simgear/structure/SGSharedPtr.hxx index c815a2fa..b8553b06 100644 --- a/simgear/structure/SGSharedPtr.hxx +++ b/simgear/structure/SGSharedPtr.hxx @@ -1,6 +1,6 @@ /* -*-c++-*- * - * Copyright (C) 2005-2009 Mathias Froehlich + * Copyright (C) 2005-2012 Mathias Froehlich * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -104,7 +104,7 @@ private: void get(const T* p) const { T::get(p); } void put(void) - { if (!T::put(_ptr)) { delete _ptr; _ptr = 0; } } + { if (!T::put(_ptr)) delete _ptr; _ptr = 0; } // The reference itself. T* _ptr; -- 2.39.5