GentenStudios / Phoenix-OLD

Phoenix is an open world sandbox style voxel game designed to make all content optional.
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Weird issue with Enet causing crash when not allocating Host on heap. #277

Closed vyomfadia closed 3 years ago

vyomfadia commented 4 years ago

Doing:

class Network
{
public:
  Network();
  ~Network() = default;

  void run();

private:
  phx::net::Host m_host;
};

Network::Network()
{
  m_host = net::Host(phx::net::Address(7777), 32, 4);
}

Network::run()
{
  while (true)
  {
    m_host.poll(50_ms, 100);
  }
}

Calling run causes a crash within enet itself, in the enet_host_service function. However, this is mitigated when doing:

m_host = new net::Host(...);

Weird issue, need to fix at some point, we can get away with allocating on the heap for now.

vyomfadia commented 3 years ago

Apparently not a thing now?