Commit 1687bd40 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

fix bug where qir-qrt would delete global_qreg before finalize called

parent ad011c77
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -467,7 +467,8 @@ void __quantum__rt__qubit_release_array(Array *q) {
  // This is to handle **multiple** calls into an FTQC kernels (Q#/OpenQASM3).
  // At the end of the execution, all registers have been deallocated.
  if (std::all_of(allocated_arrays.begin(), allocated_arrays.end(),
                  [](auto &array_ptr) { return array_ptr == nullptr; })) {
                  [](auto &array_ptr) { return array_ptr == nullptr; }) &&
      mode == QRT_MODE::FTQC) {
    if (verbose) {
      std::cout << "Reset global buffer.\n";
    }