Cuberite Forum

Full Version: [FIXED] cPlayer with NULL pointer to cClientHandle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Apparently sometimes a player still has a NULL pointer to its cClientHandle.

I noticed this in cFurnaceEntity::Tick line 187
It tries to send a cooking progress packet to a NULL pointer

This is just a reminder for me, I'll have to investigate later
cClientHandle's destructor sets cPlayer's m_ClientHandle to NULL just before detaching itself from the player object. This might be the cause.

I'd say, remove the cPlayer::SetClientHandle altogether and set the cPlayer's clienthandle to NULL in its Destroy() method. Then you'll see if there have been any more calls to SetClientHandle().
And of course you can put asserts everywhere Smile
These are all references to SetClientHandle, so really it's only called once from the cClientHandle destructor
[Image: Screenshot-2012-03-07_13.03.59.png]

You're right about removing it, it's called together with Destroy() anyway
Well, I've seen VS's "Call browser" fail too many a time, so I don't trust it anymore Wink Removing the function implementation is the easiest way to tell Smile
It's Visual Assist's reference finder thingy Wink Much better.