summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAntonis Geralis <[email protected]>2023-12-23 13:14:39 +0200
committerGitHub <[email protected]>2023-12-23 12:14:39 +0100
commit7ca95512d876c47864f066aa5e90151a48290892 (patch)
tree21c99e438bc28615d487f74e3f30b312563608b8
parentefe3510a9a2863afc48c50d38679c0d2ef1929d4 (diff)
downloadraylib-7ca95512d876c47864f066aa5e90151a48290892.tar.gz
raylib-7ca95512d876c47864f066aa5e90151a48290892.zip
Review UnloadAutomationEventList (#3658)
* Review UnloadAutomationEventList * Update raylib.h * Update rcore.c * Update core_automation_events.c * Fix mistake
-rw-r--r--examples/core/core_automation_events.c2
-rw-r--r--src/raylib.h2
-rw-r--r--src/rcore.c7
3 files changed, 4 insertions, 7 deletions
diff --git a/examples/core/core_automation_events.c b/examples/core/core_automation_events.c
index b58d572b..319b013b 100644
--- a/examples/core/core_automation_events.c
+++ b/examples/core/core_automation_events.c
@@ -98,7 +98,7 @@ int main(void)
// Supports loading .rgs style files (text or binary) and .png style palette images
if (IsFileExtension(droppedFiles.paths[0], ".txt;.rae"))
{
- UnloadAutomationEventList(&aelist);
+ UnloadAutomationEventList(aelist);
aelist = LoadAutomationEventList(droppedFiles.paths[0]);
eventRecording = false;
diff --git a/src/raylib.h b/src/raylib.h
index 206b2657..2ab3f304 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1138,7 +1138,7 @@ RLAPI unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize
// Automation events functionality
RLAPI AutomationEventList LoadAutomationEventList(const char *fileName); // Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
-RLAPI void UnloadAutomationEventList(AutomationEventList *list); // Unload automation events list from file
+RLAPI void UnloadAutomationEventList(AutomationEventList list); // Unload automation events list from file
RLAPI bool ExportAutomationEventList(AutomationEventList list, const char *fileName); // Export automation events list as text file
RLAPI void SetAutomationEventList(AutomationEventList *list); // Set automation event list to record to
RLAPI void SetAutomationEventBaseFrame(int frame); // Set automation event internal base frame to start recording
diff --git a/src/rcore.c b/src/rcore.c
index 8691be30..3ddf3596 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -2480,13 +2480,10 @@ AutomationEventList LoadAutomationEventList(const char *fileName)
}
// Unload automation events list from file
-void UnloadAutomationEventList(AutomationEventList *list)
+void UnloadAutomationEventList(AutomationEventList list)
{
#if defined(SUPPORT_AUTOMATION_EVENTS)
- RL_FREE(list->events);
- list->events = NULL;
- list->count = 0;
- list->capacity = 0;
+ RL_FREE(list.events);
#endif
}