* [PATCH] fsm-listen-darwin: free corefoundation paths
@ 2025-12-18 2:40 AZero13 via GitGitGadget
2025-12-18 16:11 ` [PATCH v2] " AZero13 via GitGitGadget
0 siblings, 1 reply; 2+ messages in thread
From: AZero13 via GitGitGadget @ 2025-12-18 2:40 UTC (permalink / raw)
To: git; +Cc: AZero13, AZero13
From: AZero13 <gfunni234@gmail.com>
They are not freed even though they should be.
Signed-off-by: Greg Funni <gfunni234@gmail.com>
---
fsm-listen-darwin: free corefoundation paths
They are not freed even though they should be.
Signed-off-by: Greg Funni gfunni234@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2129%2FAZero13%2Ffixs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2129/AZero13/fixs-v1
Pull-Request: https://github.com/git/git/pull/2129
compat/fsmonitor/fsm-darwin-gcc.h | 2 ++
compat/fsmonitor/fsm-listen-darwin.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/compat/fsmonitor/fsm-darwin-gcc.h b/compat/fsmonitor/fsm-darwin-gcc.h
index 3496e29b3a..8b4bc3a5bc 100644
--- a/compat/fsmonitor/fsm-darwin-gcc.h
+++ b/compat/fsmonitor/fsm-darwin-gcc.h
@@ -40,6 +40,7 @@ typedef const FSEventStreamRef ConstFSEventStreamRef;
typedef unsigned int CFStringEncoding;
#define kCFStringEncodingUTF8 0x08000100
+typedef const void *CFTypeRef;
typedef const struct __CFString *CFStringRef;
typedef const struct __CFArray *CFArrayRef;
typedef const struct __CFRunLoop *CFRunLoopRef;
@@ -76,6 +77,7 @@ CFStringRef CFStringCreateWithCString(void *allocator, const char *string,
CFStringEncoding encoding);
CFArrayRef CFArrayCreate(void *allocator, const void **items, long long count,
void *callbacks);
+void CFRelease(CFTypeRef cf);
void CFRunLoopRun(void);
void CFRunLoopStop(CFRunLoopRef run_loop);
CFRunLoopRef CFRunLoopGetCurrent(void);
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index 43c3a915a0..149c310433 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -455,6 +455,13 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
failed:
error(_("Unable to create FSEventStream."));
+ if (data->cfar_paths_to_watch)
+ CFRelease(data->cfar_paths_to_watch);
+ if (data->cfsr_gitdir_path)
+ CFRelease(data->cfsr_gitdir_path);
+ if (data->cfsr_worktree_path)
+ CFRelease(data->cfsr_worktree_path);
+
FREE_AND_NULL(state->listen_data);
return -1;
}
@@ -476,6 +483,13 @@ void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
FSEventStreamRelease(data->stream);
}
+ if (data->cfar_paths_to_watch)
+ CFRelease(data->cfar_paths_to_watch);
+ if (data->cfsr_gitdir_path)
+ CFRelease(data->cfsr_gitdir_path);
+ if (data->cfsr_worktree_path)
+ CFRelease(data->cfsr_worktree_path);
+
if (data->dq)
dispatch_release(data->dq);
pthread_cond_destroy(&data->dq_finished);
base-commit: c4a0c8845e2426375ad257b6c221a3a7d92ecfda
--
gitgitgadget
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2] fsm-listen-darwin: free corefoundation paths
2025-12-18 2:40 [PATCH] fsm-listen-darwin: free corefoundation paths AZero13 via GitGitGadget
@ 2025-12-18 16:11 ` AZero13 via GitGitGadget
0 siblings, 0 replies; 2+ messages in thread
From: AZero13 via GitGitGadget @ 2025-12-18 16:11 UTC (permalink / raw)
To: git; +Cc: AZero13, Greg Funni
From: Greg Funni <gfunni234@gmail.com>
They are not freed even though they should be.
Signed-off-by: Greg Funni <gfunni234@gmail.com>
---
fsm-listen-darwin: free corefoundation paths
They are not freed even though they should be.
Signed-off-by: Greg Funni gfunni234@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2129%2FAZero13%2Ffixs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2129/AZero13/fixs-v2
Pull-Request: https://github.com/git/git/pull/2129
Range-diff vs v1:
1: 164c091f1c ! 1: 90d8f11554 fsm-listen-darwin: free corefoundation paths
@@
## Metadata ##
-Author: AZero13 <gfunni234@gmail.com>
+Author: Greg Funni <gfunni234@gmail.com>
## Commit message ##
fsm-listen-darwin: free corefoundation paths
compat/fsmonitor/fsm-darwin-gcc.h | 2 ++
compat/fsmonitor/fsm-listen-darwin.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/compat/fsmonitor/fsm-darwin-gcc.h b/compat/fsmonitor/fsm-darwin-gcc.h
index 3496e29b3a..8b4bc3a5bc 100644
--- a/compat/fsmonitor/fsm-darwin-gcc.h
+++ b/compat/fsmonitor/fsm-darwin-gcc.h
@@ -40,6 +40,7 @@ typedef const FSEventStreamRef ConstFSEventStreamRef;
typedef unsigned int CFStringEncoding;
#define kCFStringEncodingUTF8 0x08000100
+typedef const void *CFTypeRef;
typedef const struct __CFString *CFStringRef;
typedef const struct __CFArray *CFArrayRef;
typedef const struct __CFRunLoop *CFRunLoopRef;
@@ -76,6 +77,7 @@ CFStringRef CFStringCreateWithCString(void *allocator, const char *string,
CFStringEncoding encoding);
CFArrayRef CFArrayCreate(void *allocator, const void **items, long long count,
void *callbacks);
+void CFRelease(CFTypeRef cf);
void CFRunLoopRun(void);
void CFRunLoopStop(CFRunLoopRef run_loop);
CFRunLoopRef CFRunLoopGetCurrent(void);
diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
index 43c3a915a0..149c310433 100644
--- a/compat/fsmonitor/fsm-listen-darwin.c
+++ b/compat/fsmonitor/fsm-listen-darwin.c
@@ -455,6 +455,13 @@ int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
failed:
error(_("Unable to create FSEventStream."));
+ if (data->cfar_paths_to_watch)
+ CFRelease(data->cfar_paths_to_watch);
+ if (data->cfsr_gitdir_path)
+ CFRelease(data->cfsr_gitdir_path);
+ if (data->cfsr_worktree_path)
+ CFRelease(data->cfsr_worktree_path);
+
FREE_AND_NULL(state->listen_data);
return -1;
}
@@ -476,6 +483,13 @@ void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
FSEventStreamRelease(data->stream);
}
+ if (data->cfar_paths_to_watch)
+ CFRelease(data->cfar_paths_to_watch);
+ if (data->cfsr_gitdir_path)
+ CFRelease(data->cfsr_gitdir_path);
+ if (data->cfsr_worktree_path)
+ CFRelease(data->cfsr_worktree_path);
+
if (data->dq)
dispatch_release(data->dq);
pthread_cond_destroy(&data->dq_finished);
base-commit: c4a0c8845e2426375ad257b6c221a3a7d92ecfda
--
gitgitgadget
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-18 16:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 2:40 [PATCH] fsm-listen-darwin: free corefoundation paths AZero13 via GitGitGadget
2025-12-18 16:11 ` [PATCH v2] " AZero13 via GitGitGadget
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).