diff options
| author | Ray <[email protected]> | 2022-11-05 00:31:13 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-11-05 00:31:13 +0100 |
| commit | ca6f58eed1dfb74d93fb5ffe222cee61c20dde80 (patch) | |
| tree | 474a9345cffdd93edf2b560ebd9581ac19c70cdd /src | |
| parent | dbdfad7ace061931da701070c5c7fbe772c57725 (diff) | |
| download | raylib-ca6f58eed1dfb74d93fb5ffe222cee61c20dde80.tar.gz raylib-ca6f58eed1dfb74d93fb5ffe222cee61c20dde80.zip | |
Update rcore.c
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/rcore.c b/src/rcore.c index b75b53b4..54feb38b 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1937,18 +1937,6 @@ void SetClipboardText(const char *text) #endif } -// Enable waiting for events on EndDrawing(), no automatic event polling -void EnableEventWaiting(void) -{ - CORE.Window.eventWaiting = true; -} - -// Disable waiting for events on EndDrawing(), automatic events polling -void DisableEventWaiting(void) -{ - CORE.Window.eventWaiting = false; -} - // Get clipboard text content // NOTE: returned string is allocated and freed by GLFW const char *GetClipboardText(void) @@ -1962,6 +1950,18 @@ const char *GetClipboardText(void) return NULL; } +// Enable waiting for events on EndDrawing(), no automatic event polling +void EnableEventWaiting(void) +{ + CORE.Window.eventWaiting = true; +} + +// Disable waiting for events on EndDrawing(), automatic events polling +void DisableEventWaiting(void) +{ + CORE.Window.eventWaiting = false; +} + // Show mouse cursor void ShowCursor(void) { @@ -3288,6 +3288,9 @@ unsigned char *DecompressData(const unsigned char *compData, int compDataSize, i // Decompress data from a valid DEFLATE stream data = RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1); int length = sinflate(data, MAX_DECOMPRESSION_SIZE*1024*1024, compData, compDataSize); + + // WARNING: RL_REALLOC can make (and leave) data copies in memory, be careful with sensitive compressed data! + // TODO: Use a different approach, create another buffer, copy data manually to it and wipe original buffer memory unsigned char *temp = RL_REALLOC(data, length); if (temp != NULL) data = temp; |
