aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglvertexarrayobjectoes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webglvertexarrayobjectoes.rs')
-rw-r--r--components/script/dom/webglvertexarrayobjectoes.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/dom/webglvertexarrayobjectoes.rs b/components/script/dom/webglvertexarrayobjectoes.rs
index 871de741c39..22d162782d8 100644
--- a/components/script/dom/webglvertexarrayobjectoes.rs
+++ b/components/script/dom/webglvertexarrayobjectoes.rs
@@ -57,16 +57,20 @@ impl WebGLVertexArrayObjectOES {
self.is_deleted.get()
}
- pub fn delete(&self) {
+ pub fn delete(&self, fallible: bool) {
assert!(self.id.is_some());
if self.is_deleted.get() {
return;
}
self.is_deleted.set(true);
- self.upcast::<WebGLObject>()
- .context()
- .send_command(WebGLCommand::DeleteVertexArray(self.id.unwrap()));
+ let context = self.upcast::<WebGLObject>().context();
+ let cmd = WebGLCommand::DeleteVertexArray(self.id.unwrap());
+ if fallible {
+ context.send_command_ignored(cmd);
+ } else {
+ context.send_command(cmd);
+ }
for attrib_data in &**self.vertex_attribs.borrow() {
if let Some(buffer) = attrib_data.buffer() {
@@ -248,7 +252,7 @@ impl WebGLVertexArrayObjectOES {
impl Drop for WebGLVertexArrayObjectOES {
fn drop(&mut self) {
if self.id.is_some() {
- self.delete();
+ self.delete(true);
}
}
}