mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Keep the monitor's whole-extent capture off the record stack
This commit is contained in:
@@ -205,7 +205,6 @@ impl Fsm for FillToolFsmState {
|
||||
#[cfg(test)]
|
||||
mod test_fill {
|
||||
pub use crate::test_utils::test_prelude::*;
|
||||
use graphene_std::Graphic;
|
||||
use graphene_std::color::SRGBA8;
|
||||
use graphene_std::vector::fill;
|
||||
|
||||
|
||||
@@ -194,6 +194,9 @@ fn monitor<'e>(
|
||||
if ctx.innermost_index() == 0
|
||||
&& let GPoll::Final(value) | GPoll::Partial(value) = &result
|
||||
{
|
||||
// The materialization below evaluates the level again; its frames sit
|
||||
// above the one this eval already claimed and must not survive.
|
||||
let mark = core_types::record::stack::sp();
|
||||
let captured = match content.layout().depth {
|
||||
// SAFETY: the value came from this edge, so it carries the edge's layout.
|
||||
0 => unsafe { RecordCapture::capture(content.layout(), content.layout().rec(value), ctx.arena()) },
|
||||
@@ -205,6 +208,9 @@ fn monitor<'e>(
|
||||
LevelStatus::Pending | LevelStatus::Error(_) => None,
|
||||
},
|
||||
};
|
||||
// SAFETY: the capture copies into the arena, so nothing borrows the
|
||||
// frames left above the mark.
|
||||
unsafe { core_types::record::stack::rewind(mark) };
|
||||
*io.lock().unwrap() = captured.map(|output| IORecord {
|
||||
input: CtxSnapshot::capture(ctx),
|
||||
output,
|
||||
|
||||
Reference in New Issue
Block a user