diff --git a/cmd/sh2peaks.cpp b/cmd/sh2peaks.cpp index ed28267904..5ccd286811 100644 --- a/cmd/sh2peaks.cpp +++ b/cmd/sh2peaks.cpp @@ -157,7 +157,7 @@ class Processor { threshold(threshold), peaks_out(npeaks), ipeaks_vox(ipeaks_data), - precomputer(use_precomputer ? new Math::SH::PrecomputedAL(lmax) : nullptr) {} + precomputer(use_precomputer ? std::make_shared>(lmax) : nullptr) {} bool operator()(const Item &item) { @@ -175,7 +175,7 @@ class Processor { for (size_t i = 0; i < size_t(dirs.rows()); i++) { Direction p(dirs(i, 0), dirs(i, 1)); - p.a = Math::SH::get_peak(item.data, lmax, p.v, precomputer); + p.a = Math::SH::get_peak(item.data, lmax, p.v, precomputer.get()); if (std::isfinite(p.a)) { for (size_t j = 0; j < all_peaks.size(); j++) { if (abs(p.v.dot(all_peaks[j].v)) > DOT_THRESHOLD) { @@ -249,7 +249,7 @@ class Processor { value_type threshold; vector peaks_out; Image ipeaks_vox; - Math::SH::PrecomputedAL *precomputer; + std::shared_ptr> precomputer; bool check_input(const Item &item) { if (ipeaks_vox.valid()) {