-
Notifications
You must be signed in to change notification settings - Fork 550
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
Resource tracking and destruction #633
Conversation
Nice! |
Looks good so far. |
use alloc::arc::{strong_count, weak_count}; | ||
use std::ops::Deref; | ||
vector.retain(|v| { | ||
strong_count(v) > 1 || weak_count(v) > 1 || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just use an if? this is a bit to tricky.
let free = !(strong_count(v) > 1 || weak_count(v) > 1);
if free { fun(param, v.deref()); }
!free
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will fix in a moment
Looks good. |
Is this still blocked? |
No, I forgot to change the issue status. It's all ready. Regards,
|
Ok, I'll merge! |
Resource tracking and destruction
633: Fix build status badge r=grovesNL a=Gordon-F fix gfx-rs#630 Co-authored-by: Igor Shaposhnik <Gordon-F@users.noreply.github.com>
Implements automatic management of the resources. Works just like RAII.
Closes #288, #617
User API changes:
factory.delete_something()
any more!Renderer
andFactory
accept all handles by reference to avoid cloningFactory
works withRawBuffer
type natively now instead ofBuffer<()>
device.after_frame()
afterglfw.swap_buffers()
TODO:
handle::Manager
)after_free()