AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   hook virtual destructor (https://forums.alliedmods.net/showthread.php?t=153270)

raydan 03-21-2011 00:08

hook virtual destructor
 
13 CCSGameRules::~CCSGameRules()

SH_DECL_MANUALHOOK0_void(GameRulesDestructorH ook, 0, 0, 0);

any idea?

asherkin 03-21-2011 02:15

Re: hook virtual destructor
 
Quote:

Originally Posted by raydan (Post 1436800)
any idea?

about?

raydan 03-21-2011 03:27

Re: hook virtual destructor
 
Quote:

Originally Posted by asherkin (Post 1436817)
about?

can't use
SH_DECL_MANUALHOOK0_void(GameRulesDestructorH ook, 0, 0, 0);
SH_DECL_MANUALHOOK0(GameRulesDestructorH ook, 0, 0, 0,);

i use SH_DECL_MANUALHOOK0_void & crash

PM 03-21-2011 10:58

Re: hook virtual destructor
 
Does it crash on hook installation or when the destructor is being called?

Edit: GCC / MSVC?

raydan 03-21-2011 20:47

Re: hook virtual destructor
 
using msvc,
which one should i use? SH_DECL_MANUALHOOK0_void or SH_DECL_MANUALHOOK0?

BAILOPAN 03-21-2011 21:41

Re: hook virtual destructor
 
Destructors have no return value.

raydan 03-21-2011 23:06

Re: hook virtual destructor
 
Quote:

Originally Posted by BAILOPAN (Post 1437412)
Destructors have no return value.

i know destructor no return, but which SH_DECL_MANUALHOOK0 should i use?

asherkin 03-21-2011 23:58

Re: hook virtual destructor
 
Quote:

Originally Posted by raydan (Post 1437431)
i know destructor no return, but which SH_DECL_MANUALHOOK0 should i use?

The one for things with no return value?

Think about how you declare functions like that.
Code:

void blah();
Could it possibly be the _void one then?

:bacon!:

raydan 03-22-2011 00:26

Re: hook virtual destructor
 
Quote:

Originally Posted by asherkin (Post 1437441)
The one for things with no return value?

Think about how you declare functions like that.
Code:

void blah();
Could it possibly be the _void one then?

:bacon!:

Code:

class xx{
public:
xx()
{

}
~xx()
{

}
void yy()
{

}

} g_xx;

i use SH_ADD_* hook xx(), ~xx(), not work, can't compile, c2277 error
hook yy(), can compile, but crash on runtime

BAILOPAN 03-22-2011 01:11

Re: hook virtual destructor
 
Nothing in that sample class is virtual.


All times are GMT -4. The time now is 09:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.