End child task when parent task is deleted

I’m writing a class for use during the autonomous task which manages a few tasks as members. Ideally, the class’s destructor would be called when autonomous ends and I could manage the tasks using RAII. However, I do not think they’re called by pros when autonomous ends.
So, I was planning to call pros::c::task_notify_when_deleting in the class constructor in a way that the member tasks would be notified to exit themselves. The problem is that I cannot find a way to get the member pros::Task's internal, private pros::task_t to pass to pros::c::task_notify_when_deleting.

Example Code
class myClass {
      : internalTask([]() {
          while (pros::Task::notify_take(true, 10)) {
            // Do task stuff
        }) {
        pros::c::task_get_current(), // Notify when the current (auton) task ends
        internalTask, 1,             // Cant get the proper task type to pass in
  ~myClass() { // Ideally the destructor would be called as auton ends
  pros::Task internalTask;

The issue is with the type of internalTask on the line
internalTask, 1, // Cant get the proper task type to pass in

Is there a better way to clean up tasks (and other resources) when autonoumous exits? Is there any way to get pros to call the class’s destructor?

Found an undocumented operator overload which gets the pros::Task internal pros::task_t

	 * Convert this object to a C task_t handle
	explicit operator task_t() {
		return task;

This lets you do

pros::Task myTask([](){ 
  // Task Stuff
pros::task_t internalTask = (pros::task_t)myTask;

Then internalTask may be passed to pros::c::task_notify_when_deleting.