I have the following constructor:
MutexWrapper::MutexWrapper(Mutex * pMutex)
{
DebugPrint("0x%x", pMutex); // displays 0x1f83e54
}
And it gets called in the following function:
void OnReviewBuffer_Callback( void * pUserData )
{
ReviewBuffer * thePointer = (ReviewBuffer *) pUserData;
DebugPrint("0x%x", thePointer); // this displays 0x1f83e48
MutexWrapper theMutexWrapper(thePointer);
}
Unfortunately I can't provide the entire definition of ReviewBuffer - but I hope the below is enough:
class ReviewBuffer : public StreamConsumer_Base, public Mutex
{
...
};
The problem is that when I print out thePointer I get 0x1f83e48, but the value printed from inside the constructor is 0x1f83e54.
Why are the pointer values different - is this something to do with pass by value passing in a copy of the pointer?