+
+MAKE_SCHEME_CALLBACK (Partial_iterator, finalization, 2);
+SCM
+Partial_iterator::finalization (SCM ctx, SCM length)
+{
+ LY_ASSERT_SMOB (Context, ctx, 1);
+ LY_ASSERT_SMOB (Moment, length, 2);
+ Context *timing = Context::unsmob
+ (scm_call_2 (ly_lily_module_constant ("ly:context-find"),
+ ctx,
+ ly_symbol2scm ("Timing")));
+ if (!timing) {
+ programming_error ("missing Timing in \\partial");
+ return SCM_UNSPECIFIED;
+ }
+ Moment mp = robust_scm2moment (timing->get_property ("measurePosition"),
+ Rational (0));
+ mp.main_part_ = measure_length (timing);
+ timing->set_property ("measurePosition",
+ (mp - *Moment::unsmob (length)).smobbed_copy ());
+ timing->unset_property (ly_symbol2scm ("partialBusy"));
+
+ return SCM_UNSPECIFIED;
+}