mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Don't free icon pixel data.
This commit is contained in:
parent
add5c1e328
commit
2c31ba8016
@ -118,6 +118,8 @@ static RunQueue mainThreadTasks;
|
|||||||
static uint32_t updateVersion = 0;
|
static uint32_t updateVersion = 0;
|
||||||
static bool showReleaseNotes = false;
|
static bool showReleaseNotes = false;
|
||||||
static std::string releaseNotes;
|
static std::string releaseNotes;
|
||||||
|
static uint8_t* iconPx;
|
||||||
|
static int iconX, iconY;
|
||||||
|
|
||||||
void RunOnMainThread( std::function<void()> cb, bool forceDelay = false )
|
void RunOnMainThread( std::function<void()> cb, bool forceDelay = false )
|
||||||
{
|
{
|
||||||
@ -228,11 +230,14 @@ int main( int argc, char** argv )
|
|||||||
GLFWwindow* window = glfwCreateWindow( winPos.w, winPos.h, title, NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow( winPos.w, winPos.h, title, NULL, NULL);
|
||||||
if( !window ) return 1;
|
if( !window ) return 1;
|
||||||
|
|
||||||
|
iconPx = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &iconX, &iconY, nullptr, 4 );
|
||||||
|
|
||||||
{
|
{
|
||||||
GLFWimage icon;
|
GLFWimage icon;
|
||||||
icon.pixels = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &icon.width, &icon.height, nullptr, 4 );
|
icon.width = iconX;
|
||||||
|
icon.height = iconY;
|
||||||
|
icon.pixels = iconPx;
|
||||||
glfwSetWindowIcon( window, 1, &icon );
|
glfwSetWindowIcon( window, 1, &icon );
|
||||||
free( icon.pixels );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwSetWindowPos( window, winPos.x, winPos.y );
|
glfwSetWindowPos( window, winPos.x, winPos.y );
|
||||||
@ -344,6 +349,7 @@ int main( int argc, char** argv )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
free( iconPx );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user