Allow persona_scope destructor after finalize

Issue #146 resolved
Dan Bonachea created an issue

Currently the persona destructor is specified to permit invocation after finalize, but the persona_scope destructor is not.

Sample program of why this matters:

#include <upcxx/upcxx.hpp>

int main() {
  upcxx::init();

  upcxx::liberate_master_persona();

  // rest of app goes here...

  { upcxx::persona_scope ps(upcxx::master_persona());
    upcxx::finalize();
  }
  return 0;
}

Any program that calls liberate_master_persona() will be unable to call finalize with the master persona without creating a persona_scope object that outlives finalize and calls the persona_scope destructor with an uninitialized library.

I suspect this is a simple oversight, but one that should be corrected.

Comments (1)

  1. Log in to comment