Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions wavefront.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ wavefront::wavefront():
{
}

wavefront::~wavefront()
{

data.release();
mask.release();
workData.release();
workMask.release();
InputZerns.clear();
nulledData.release();

}
wavefront::wavefront( const wavefront &wf):
data(wf.data.clone()),
nulledData(wf.nulledData.clone()),
Expand All @@ -46,6 +35,7 @@ wavefront::wavefront( const wavefront &wf):
GBSmoothingValue(wf.GBSmoothingValue),
m_origin(wf.m_origin),
m_manuallyInverted(wf.m_manuallyInverted),
name(wf.name),
lambda(wf.lambda),
m_outside(wf.m_outside),
m_inside(wf.m_inside),
Expand All @@ -55,6 +45,8 @@ wavefront::wavefront( const wavefront &wf):
max(wf.max),
std(wf.std),
mean(wf.mean),
dirtyZerns(wf.dirtyZerns)
dirtyZerns(wf.dirtyZerns),
regions(wf.regions),

@gr5 gr5 Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me nervous (line 49 - the regions copy)

  1. Does it do a deep copy?
  2. Previous behavior you got a regions member that was empty and ready to be filled with fresh regions. Does the existing code expect this everywhere or does it not care? Did you check all the times he adds regions and might we get doubled regions?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand this might fix some bug I didn't really know was easy to fix that I forgot about. Maybe regions can get lost after certain operations and maybe that's bad.

regions_have_been_expanded(wf.regions_have_been_expanded)
{}

2 changes: 1 addition & 1 deletion wavefront.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class wavefront
{
public:
wavefront();
~wavefront();
~wavefront() = default;
wavefront( const wavefront &wf); // copy constructor doing deep copy of cv::Mat
wavefront( wavefront && ) = delete; // move constructor, deleted because unused
wavefront& operator=( const wavefront & ) = default; // copy operator not doing deep copy of cv::mat
Expand Down
Loading