mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Don't panic if WebGL thread can't be reached during finalization.
This commit is contained in:
parent
eb4f2d150a
commit
8f5c37c0b5
8 changed files with 78 additions and 43 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue