View Single Post
Afronanny
Veteran Member
Join Date: Aug 2009
Old 07-15-2011 , 23:49   Re: [WIP] Builtin Votes
Reply With Quote #2

Oh my gosh you don't have VS2010?! It's so much better.

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.

Last edited by Afronanny; 07-15-2011 at 23:55.
Afronanny is offline