MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / drop

Method drop

canvas/src/canvas.rs:180–197  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

178
179impl Drop for Canvas {
180 fn drop(&mut self) {
181 // The streams drop if this is the last canvas with this core
182 self.core.sync(|core| {
183 if core.main_core.finish_usage() == 0 {
184 // Close all the streams and then wake them up
185 core.streams.drain(..)
186 .map(|stream| {
187 if let Some(stream) = stream.upgrade() {
188 stream.sync(|stream| { stream.close(); stream.take_waker() })
189 } else {
190 None
191 }
192 })
193 .flatten()
194 .for_each(|waker| waker.wake());
195 }
196 });
197 }
198}
199
200///

Callers

nothing calls this directly

Calls 5

finish_usageMethod · 0.80
mapMethod · 0.80
take_wakerMethod · 0.80
closeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected