File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed
crates/bevy_mod_scripting_core/src/bindings Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -172,29 +172,13 @@ impl<'w> WorldAccessGuard<'w> {
172
172
173
173
/// Runs a closure within an isolated access scope, releasing leftover accesses, should only be used in a single-threaded context.
174
174
///
175
- /// Will throw an error if the length of the accesses after the closure is run, is not the same as at the beginning, to prevent safety issues.
176
- ///
177
175
/// Safety:
178
176
/// - The caller must ensure it's safe to release any potentially locked accesses.
179
177
pub ( crate ) unsafe fn with_access_scope < O , F : FnOnce ( ) -> O > (
180
178
& self ,
181
179
f : F ,
182
180
) -> Result < O , InteropError > {
183
- let length_start = self . inner . accesses . count_accesses ( ) ;
184
- let ( o, length_end) = self . inner . accesses . with_scope ( || {
185
- let o = f ( ) ;
186
- ( o, self . inner . accesses . count_accesses ( ) )
187
- } ) ;
188
- // TODO: re-enable this when
189
- // if length_start != length_end {
190
- // return Err(InteropError::invalid_access_count(
191
- // length_end,
192
- // length_start,
193
- // "Component/Resource/Allocation locks (accesses) were not released correctly in an access scope",
194
- // ));
195
- // }
196
-
197
- Ok ( o)
181
+ Ok ( self . inner . accesses . with_scope ( f) )
198
182
}
199
183
200
184
/// Purely debugging utility to list all accesses currently held.
You can’t perform that action at this time.
0 commit comments