[haiku-commits] haiku: hrev54775 - headers/private/fs_shell

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Dec 2020 12:02:23 -0500 (EST)

hrev54775 adds 1 changeset to branch 'master'
old head: efc042ff484bb6125a8a533c7d942edb7b2de9bc
new head: 5b627acb33d64d5f524b090ba16343a7d3eccec8
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=5b627acb33d6+%5Eefc042ff484b

----------------------------------------------------------------------------

5b627acb33d6: Build fix.
  
  Desynchronisation between fs_shell and normal autodeleter files

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev54775
Commit:      5b627acb33d64d5f524b090ba16343a7d3eccec8
URL:         https://git.haiku-os.org/haiku/commit/?id=5b627acb33d6
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Dec 10 17:01:22 2020 UTC

----------------------------------------------------------------------------

1 file changed, 11 insertions(+), 21 deletions(-)
headers/private/fs_shell/fssh_auto_deleter.h | 32 ++++++++----------------

----------------------------------------------------------------------------

diff --git a/headers/private/fs_shell/fssh_auto_deleter.h 
b/headers/private/fs_shell/fssh_auto_deleter.h
index d2948951ae..1fb36974c5 100644
--- a/headers/private/fs_shell/fssh_auto_deleter.h
+++ b/headers/private/fs_shell/fssh_auto_deleter.h
@@ -129,41 +129,31 @@ struct MemoryDeleter : AutoDeleter<void, MemoryDelete >
 
 // CObjectDeleter
 
-template<typename Type, typename DestructorReturnType>
+template<typename Type, typename DestructorReturnType,
+       DestructorReturnType (*Destructor)(Type*)>
 struct CObjectDelete
 {
        inline void operator()(Type *object)
        {
-               if (fDestructor != NULL && object != NULL)
-                       fDestructor(object);
-       }
-
-       template<typename Destructor>
-       inline void operator=(Destructor destructor)
-       {
-               fDestructor = destructor;
+               if (object != NULL)
+                       Destructor(object);
        }
-
-private:
-       DestructorReturnType (*fDestructor)(Type*);
 };
 
-template<typename Type, typename DestructorReturnType = void>
+template<typename Type, typename DestructorReturnType,
+       DestructorReturnType (*Destructor)(Type*)>
 struct CObjectDeleter
-       : AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType> >
+       : AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType, 
Destructor> >
 {
-       typedef AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType> > 
Base;
+       typedef AutoDeleter<Type,
+               CObjectDelete<Type, DestructorReturnType, Destructor> > Base;
 
-       template<typename Destructor>
-       CObjectDeleter(Destructor destructor) : Base()
+       CObjectDeleter() : Base()
        {
-               Base::fDelete = destructor;
        }
 
-       template<typename Destructor>
-       CObjectDeleter(Type *object, Destructor destructor) : Base(object)
+       CObjectDeleter(Type *object) : Base(object)
        {
-               Base::fDelete = destructor;
        }
 };
 


Other related posts:

  • » [haiku-commits] haiku: hrev54775 - headers/private/fs_shell - Adrien Destugues