1 diff --git a/include/Sacrifice/UserHooksFactory.hh b/include/Sacrifice/UserHooksFactory.hh
2 index 04b105b..19f2b4f 100644
3 --- a/include/Sacrifice/UserHooksFactory.hh
4 +++ b/include/Sacrifice/UserHooksFactory.hh
9 - using Pythia8::UserHooks;
10 + using Pythia8::UserHooksPtr;
14 @@ -21,7 +21,7 @@ namespace Sacrifice{
18 - static UserHooks* create(const string &hookName);
19 + static UserHooksPtr create(const string &hookName);
22 * Loads a library of UserHooks
23 @@ -39,7 +39,7 @@ namespace Sacrifice{
27 - virtual UserHooks *create() const = 0;
28 + virtual UserHooksPtr create() const = 0;
29 virtual ~ICreator(){};
32 @@ -61,8 +61,8 @@ namespace Sacrifice{
36 - UserHooks *create()const{
38 + UserHooksPtr create()const{
39 + return std::make_shared<T>();
43 diff --git a/src/UserHooksFactory.cxx b/src/UserHooksFactory.cxx
44 index 84a485b..5274119 100644
45 --- a/src/UserHooksFactory.cxx
46 +++ b/src/UserHooksFactory.cxx
47 @@ -11,7 +11,7 @@ namespace Sacrifice{
50 //////////////////////////////////////////////////////////////////////////////
51 - UserHooks *UserHooksFactory::create(const string &name){
52 + UserHooksPtr UserHooksFactory::create(const string &name){
53 map<string, const ICreator*>::const_iterator it = s_creators().find(name);
54 if(it == s_creators().end()){