mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue