-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Fallback for no ARC, fix for #8166 #8565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
slight fix in impl_osx
This PR looks solid and addresses two important issues: set_source_files_properties( ensures that ARC takes care of memory management automatically.
In cases where ARC isn’t active, your addition of an explicit destructor for frame descriptor and buffer caching provides robustness. By conditionally compiling the explicit destructor using if (__has_feature(objc_arc)), the code now gracefully handles both ARC and non-ARC contexts. Overall, your changes not only address the leak issue but also add a layer of robustness across different compilation environments. Thanks for the contribution—this should help prevent memory issues and improve overall stability on Metal backends. |
Thanks for your PR.
Thank you. |
I have picked the OSX backend change as d3bb333 instead, simply removing the line and I'm not sure I understand why you didn't do that, since the event's modifierFlags has not changed? |
9ff64e1 here i fixed formatting. i do not have an opinion on why there is cache and not couple reusable buffers. Also to my naive understanding purging all buffers on per second basis seems little erroneous, feels like every buffer should be timestamped so purge will happen only to old buffers, not to working correct ones(?) as for why in impl_OSX i just assumed intent and selected path of least change. There is no obvious reason for that line to be there. Thanks |
You shoudn't be using chat bots but looking at the code and seeing if your change would make better sense inside |
When no arc enabled metal backend leaks framedescriptor and buffers.
I guess proper way to solve this would be to activate arc, in cmake like this:
for framedescriptor and buffer caching.
This code is behind conditional
if (__has_feature(objc_arc))
,so it works in both contexts adding robustness
removing type definition made it work.