auto merge of #2068 : mbrubeck/servo/1187-buffer-destroy, r=larsbergstrom

This fixes a potential pixmap leak and task failure when the LayerBuffer is dropped (#1187).

I wasn't able to reproduce the failure using the steps from #1187, but based on the stack trace I think this is the correct fix.  Alternately, would it make sense to `impl Drop for LayerBuffer`?
This commit is contained in:
bors-servo 2014-04-10 09:55:38 -04:00
commit 08f53acd09

View file

@ -83,6 +83,7 @@ impl<T: Tile> BufferMap<T> {
// memory limit, no need to store this new buffer; just let it drop. // memory limit, no need to store this new buffer; just let it drop.
if self.mem + new_buffer.get_mem() > self.max_mem && self.map.len() == 1 && if self.mem + new_buffer.get_mem() > self.max_mem && self.map.len() == 1 &&
self.map.contains_key(&new_key) { self.map.contains_key(&new_key) {
new_buffer.destroy(graphics_context);
return; return;
} }