View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-16-2011 , 00:06   Re: [WIP] Builtin Votes
Reply With Quote #3

Quote:
Originally Posted by Afronanny View Post
Oh my gosh you don't have VS2010?! It's so much better.
I do at home, but not at work.

Quote:
Originally Posted by Afronanny View Post
Also, I can see a possible place where a crash might happen in CreateBuiltinVote: You create a pointer but never check to see that it's valid before making a call to one of its members.
Code:
 IBaseBuiltinVote *vote = g_BuiltinVoteManager.CreateVote(handler, pContext->GetIdentity(), params[4], startTranslation);
might want to add something like

Code:
if (!vote)
    return -1;
after you create the vote, just to make sure it doesn't crash there if you run out of memory or can't create a new vote object for whatever reason.
I'll probably work on this some tomorrow. I'll keep that in mind.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline