eo: handle NULL nicely in efl_replace.
authorCedric Bail <cedric@osg.samsung.com>
Fri, 6 Apr 2018 21:42:58 +0000 (14:42 -0700)
committerWonki Kim <wonki_.kim@samsung.com>
Thu, 31 May 2018 07:00:49 +0000 (16:00 +0900)
src/lib/eo/Eo.h

index f511562..e7ec0a7 100644 (file)
@@ -2047,7 +2047,7 @@ static inline void
 efl_replace(Eo **storage, Eo *new_obj)
 {
    if (!storage || *storage == new_obj) return;
-   efl_ref(new_obj);
+   if (new_obj) efl_ref(new_obj);
    efl_unref(*storage);
    *storage = new_obj;
 }