Auto merge of #25998 - jdm:vao-drop, r=nox

Avoid a panic when closing webgl pages using VAOs

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25891
- [x] These changes do not require tests because GC behaviour at shutdown is nondeterministic and difficult to test
This commit is contained in:
bors-servo 2020-03-27 09:55:12 -04:00 committed by GitHub
commit a927f1ad8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 12 deletions

View file

@ -220,7 +220,7 @@ impl WebGL2RenderingContext {
fn unbind_from(&self, slot: &MutNullableDom<WebGLBuffer>, buffer: &WebGLBuffer) {
if slot.get().map_or(false, |b| buffer == &*b) {
buffer.decrement_attached_counter();
buffer.decrement_attached_counter(false);
slot.set(None);
}
}
@ -3403,7 +3403,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
for slot in &[&generic_slot, &indexed_binding.buffer] {
if let Some(old) = slot.get() {
old.decrement_attached_counter();
old.decrement_attached_counter(false);
}
slot.set(buffer);
}
@ -3481,7 +3481,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
for slot in &[&generic_slot, &indexed_binding.buffer] {
if let Some(old) = slot.get() {
old.decrement_attached_counter();
old.decrement_attached_counter(false);
}
slot.set(buffer);
}