Raised This Month: $12 Target: $400
 3% 

hook virtual destructor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raydan
Senior Member
Join Date: Aug 2006
Old 03-21-2011 , 00:08   hook virtual destructor
Reply With Quote #1

13 CCSGameRules::~CCSGameRules()

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

any idea?
raydan is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-21-2011 , 02:15   Re: hook virtual destructor
Reply With Quote #2

Quote:
Originally Posted by raydan View Post
any idea?
about?
__________________
asherkin is offline
raydan
Senior Member
Join Date: Aug 2006
Old 03-21-2011 , 03:27   Re: hook virtual destructor
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
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
raydan is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-21-2011 , 10:58   Re: hook virtual destructor
Reply With Quote #4

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

Edit: GCC / MSVC?
__________________
hello, i am pm

Last edited by PM; 03-21-2011 at 11:33.
PM is offline
raydan
Senior Member
Join Date: Aug 2006
Old 03-21-2011 , 20:47   Re: hook virtual destructor
Reply With Quote #5

using msvc,
which one should i use? SH_DECL_MANUALHOOK0_void or SH_DECL_MANUALHOOK0?
raydan is offline
BAILOPAN
Join Date: Jan 2004
Old 03-21-2011 , 21:41   Re: hook virtual destructor
Reply With Quote #6

Destructors have no return value.
__________________
egg
BAILOPAN is offline
raydan
Senior Member
Join Date: Aug 2006
Old 03-21-2011 , 23:06   Re: hook virtual destructor
Reply With Quote #7

Quote:
Originally Posted by BAILOPAN View Post
Destructors have no return value.
i know destructor no return, but which SH_DECL_MANUALHOOK0 should i use?
raydan is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-21-2011 , 23:58   Re: hook virtual destructor
Reply With Quote #8

Quote:
Originally Posted by raydan View Post
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?

__________________
asherkin is offline
raydan
Senior Member
Join Date: Aug 2006
Old 03-22-2011 , 00:26   Re: hook virtual destructor
Reply With Quote #9

Quote:
Originally Posted by asherkin View Post
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?

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
raydan is offline
BAILOPAN
Join Date: Jan 2004
Old 03-22-2011 , 01:11   Re: hook virtual destructor
Reply With Quote #10

Nothing in that sample class is virtual.
__________________
egg
BAILOPAN is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:21.


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