aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgltexture.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webgltexture.rs')
-rw-r--r--components/script/dom/webgltexture.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs
index 8982e4bca0c..a7e548dcdef 100644
--- a/components/script/dom/webgltexture.rs
+++ b/components/script/dom/webgltexture.rs
@@ -180,7 +180,7 @@ impl WebGLTexture {
self.populate_mip_chain(self.base_mipmap_level, last_level)
}
- pub fn delete(&self) {
+ pub fn delete(&self, fallible: bool) {
if !self.is_deleted.get() {
self.is_deleted.set(true);
let context = self.upcast::<WebGLObject>().context();
@@ -204,7 +204,12 @@ impl WebGLTexture {
fb.detach_texture(self);
}
- context.send_command(WebGLCommand::DeleteTexture(self.id));
+ let cmd = WebGLCommand::DeleteTexture(self.id);
+ if fallible {
+ context.send_command_ignored(cmd);
+ } else {
+ context.send_command(cmd);
+ }
}
}
@@ -404,7 +409,7 @@ impl WebGLTexture {
impl Drop for WebGLTexture {
fn drop(&mut self) {
- self.delete();
+ self.delete(true);
}
}