+
+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 = unsmob<Context>
+ (Lily::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 - *unsmob<Moment> (length)).smobbed_copy ());
+ timing->unset_property (ly_symbol2scm ("partialBusy"));
+
+ return SCM_UNSPECIFIED;
+}