Skip to content

Commit

Permalink
Fix label leak (#3053)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 authored Sep 27, 2022
1 parent b65ebb4 commit c927e81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions wgpu-hal/src/metal/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
} else {
queue.new_command_buffer_with_unretained_references()
};
if let Some(label) = label {
cmd_buf_ref.set_label(label);
}
cmd_buf_ref.to_owned()
});

if let Some(label) = label {
raw.set_label(label);
}
self.raw_cmd_buf = Some(raw);

Ok(())
Expand Down
4 changes: 3 additions & 1 deletion wgpu-hal/src/metal/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ impl crate::Device<super::Api> for super::Device {
},
);
if let Some(label) = desc.label {
raw.set_label(label);
objc::rc::autoreleasepool(|| {
raw.set_label(label);
});
}
raw
};
Expand Down

0 comments on commit c927e81

Please sign in to comment.