We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally, The following codes can work well under VS2008. However, exception is thrown from SharedDtor() after upgrading to VS2013.
SharedDtor()
AGAMMQ_MESSAGE SerializeMsgMgr::CreateHostOnOffline() { AGAMMQ_MESSAGE oMsg; memset(&oMsg,0,sizeof(AGAMMQ_MESSAGE)); UIMessage uiMsg; uiMsg.set_version(toolset->Lic().GetVersion()); UIMessage_Type msgType = uiMsg.msgtype(); msgType = UIMessage_Type::UIMessage_Type_HOST_ON_OFF_LINE; uiMsg.set_msgtype(msgType); uiMsg.set_sequencenumber(0); uiMsg.set_bonusnumber(toolset->State().MyBonusUID().Bonus()); HostOnOffline aHostOnOffline = uiMsg.hostonoffline(); aHostOnOffline.set_ipaddress(std::string(ServerService::GetIPString())); aHostOnOffline.set_version(toolset->Lic().GetVersion()); BonusType aType = aHostOnOffline.bonustype(); aType = BonusType::LUCKY_COIN; aHostOnOffline.set_type(aType); HostType aHostType = aHostOnOffline.hosttype(); aHostType = HostType::UNIFIED_SERVER; aHostOnOffline.set_hosttype(aBonusHostType); aHostOnOffline.set_time(GetCurrentTime()); uiMsg.set_allocated_hostonoffline(&aHostOnOffline); int nBytes = uiMsg.ByteSize(); if (nBytes <= 0) { return oMsg; } byte* pArray = new byte[nBytes]; if (NULL == pArray) { return oMsg; } try{ if (!uiMsg.SerializeToArray(pArray, nBytes)) { delete [] pArray; return oMsg; } } catch(std::exception e) { } return oMsg; }
The text was updated successfully, but these errors were encountered:
The following line causes the problem: uiMsg.set_allocated_hostonoffline(&aHostOnOffline);
Please refer to https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#fields for the behavior of set_allocated_foo.
Sorry, something went wrong.
No branches or pull requests
Originally, The following codes can work well under VS2008. However, exception is thrown from
SharedDtor()
after upgrading to VS2013.The text was updated successfully, but these errors were encountered: