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
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue