sourcehook/test/testrecall.cpp
changeset 387 093c72464b35
parent 380 f9e21a2ac558
     1.1 --- a/sourcehook/test/testrecall.cpp	Sun Oct 07 23:00:38 2007 +0000
     1.2 +++ b/sourcehook/test/testrecall.cpp	Mon Oct 08 14:20:51 2007 +0000
     1.3 @@ -112,6 +112,11 @@
     1.4  	SH_DECL_HOOK1_void(Test, Func1, SH_NOATTRIB, 0, int);
     1.5  	SH_DECL_HOOK1(Test, Func2, SH_NOATTRIB, 0, int, int);
     1.6  	SH_DECL_HOOK2(Test, Func2, SH_NOATTRIB, 1, int, int, int);
     1.7 +
     1.8 +	Test *MyTestFactory()
     1.9 +	{
    1.10 +		return new Test;
    1.11 +	}
    1.12  }
    1.13  
    1.14  bool TestRecall(std::string &error)
    1.15 @@ -119,8 +124,8 @@
    1.16  	GET_SHPTR(g_SHPtr);
    1.17  	g_PLID = 1337;
    1.18  
    1.19 -	Test inst;
    1.20 -	Test *ptr = &inst;
    1.21 +	Test *ptr = MyTestFactory();
    1.22 +	CAutoPtrDestruction<Test> apd(ptr);
    1.23  
    1.24  	SH_ADD_HOOK(Test, Func1, ptr, SH_STATIC(Handler1_Func1), false);
    1.25  	SH_ADD_HOOK(Test, Func1, ptr, SH_STATIC(Handler2_Func1), false);