Skip to content

Commit a45d3ae

Browse files
committed
server: fix httpclient instance creation on certain older MSVC runtimes
1 parent c01ddae commit a45d3ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

code/components/citizen-server-impl/src/ServerCommerce.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CommerceComponent : public fwRefCountable
5757
std::set<int> m_ownedSkus;
5858
};
5959

60-
static HttpClient* httpClient = new HttpClient(L"FXServer/Licensing");
60+
static HttpClient* httpClient;
6161

6262
void CommerceComponent::LoadCommerceData()
6363
{
@@ -158,6 +158,8 @@ DECLARE_INSTANCE_TYPE(CommerceComponent);
158158

159159
static InitFunction initFunction([]()
160160
{
161+
httpClient = new HttpClient(L"FXServer/Licensing");
162+
161163
fx::ScriptEngine::RegisterNativeHandler("CAN_PLAYER_START_COMMERCE_SESSION", MakeClientFunction([](fx::ScriptContext& context, const std::shared_ptr<fx::Client>& client) -> uint32_t
162164
{
163165
return client->GetComponent<CommerceComponent>()->GetUserId() ? true : false;

0 commit comments

Comments
 (0)