diff options
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r-- | components/script/dom/webglframebuffer.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 86fb30fb8fd..114ede38b01 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -140,12 +140,16 @@ impl WebGLFramebuffer { )); } - pub fn delete(&self) { + pub fn delete(&self, fallible: bool) { if !self.is_deleted.get() { self.is_deleted.set(true); - self.upcast::<WebGLObject>() - .context() - .send_command(WebGLCommand::DeleteFramebuffer(self.id)); + let context = self.upcast::<WebGLObject>().context(); + let cmd = WebGLCommand::DeleteFramebuffer(self.id); + if fallible { + context.send_command_ignored(cmd); + } else { + context.send_command(cmd); + } } } @@ -588,7 +592,7 @@ impl WebGLFramebuffer { impl Drop for WebGLFramebuffer { fn drop(&mut self) { - self.delete(); + self.delete(true); } } |