Skip to content

Instantly share code, notes, and snippets.

@kkabdol
Last active January 29, 2016 05:16
Show Gist options
  • Save kkabdol/4e67234714376ef33a67 to your computer and use it in GitHub Desktop.
Save kkabdol/4e67234714376ef33a67 to your computer and use it in GitHub Desktop.
Returning a reference to a function-local static variable
int32& FIOSAudioDevice::GetSuspendCounter()
{
static int32 SuspendCounter = 0;
return SuspendCounter;
}
void FIOSAudioDevice::ResumeContext()
{
int32& SuspendCounter = GetSuspendCounter();
...
}
@kkabdol
Copy link
Author

kkabdol commented Jan 29, 2016

UE4\Engine\Source\Runtime\IOS\IOSAudio\Private\IOSAudioDevice.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment