Hey all I'm getting a segfault problem now. I tried to put in the
eval.c sample into my app with some changes and it processes find but
then the next call to the app it seg faults
Here is the relavant code
extern "C" {
#include "poker_defs.h"
#include "inlines/eval.h"
#include "inlines/eval_low.h"
#include "deck_std.h"
}
void serverInfo::endHand() {
int gNCards;
CardMask gCards;
int gLow=0;
int gHighLow=0;
HandVal handval;
LowHandVal low;
gNCards = 0;
CardMask_RESET(gCards);
cout << "i need to find a WINNER!" << endl;
for (int i=0; i<9; i++) {
ptrType2 Cur = sitDownList->returnNode(i);
if (Cur != NULL) {
if (Cur->status == 1) {
CardMask_SET(gCards, Cur->holdCards[0]);
++gNCards;
CardMask_SET(gCards, Cur->holdCards[1]);
++gNCards;
CardMask_SET(gCards, this->communityCards[0]);
++gNCards;
CardMask_SET(gCards, this->communityCards[1]);
++gNCards;
CardMask_SET(gCards, this->communityCards[2]);
++gNCards;
CardMask_SET(gCards, this->communityCards[3]);
++gNCards;
CardMask_SET(gCards, this->communityCards[4]);
++gNCards;
if (!gLow) {
handval = Hand_EVAL_N(gCards, gNCards);
//cout << handval << endl;
//printf("%s \n", handval);
//printf("%s: ", Deck_maskString(gCards));
//HandVal_print(handval);
char *str;
//QString *str;
//str->append("bla");
HandVal_toString(handval, str);
cout << str << endl;
//printf("\n");
}
}
}
}
cout << "i am done!" << endl;
}
its something with HandVal_toString that is causing it to error. For
example my server right now is a gui client and once the clients
finish their hand.. if i place my house over the server window it
crashes.. cause it wants to hand a x11Event.. so i tried to make it
text based and the next incoming client it seg faults.. so its
something to do with HandVal_toString.
If i just use HandVal_print() it works just fine.. I'm stumped here..
thanks for the help again
Mike