Skip to content

Commit

Permalink
[osx] Fix memory leaks using -fobjc-arc correctly
Browse files Browse the repository at this point in the history
The -fobjc-arc flags must be specified for the compiler, not in the
linker. This generates a lot of memory leaks when we copy content into
the clipboard (just testing copy/put_image examples with a for loop to
repeat the action can easily show this leak).

This might be the reason of some memory leaks reported on the macOS
port of Aseprite: aseprite/aseprite#4251
  • Loading branch information
dacap committed Apr 12, 2024
1 parent f4dea32 commit 1d5d20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(WIN32)
endif()
endif()
elseif(APPLE)
target_link_options(clip PRIVATE -fobjc-arc)
target_compile_options(clip PRIVATE -fobjc-arc)

find_library(COCOA_LIBRARY Cocoa)
if(COCOA_LIBRARY)
Expand Down

0 comments on commit 1d5d20c

Please sign in to comment.