bmeaut / grainautline

GrainAutLine: image processing for geology and material sciences
GNU General Public License v3.0
0 stars 2 forks source link

Do not let layers modify the processors. #110

Closed csorbakristof closed 4 years ago

csorbakristof commented 8 years ago

For example "ShowImageProcessor location2blobIndex".

ShowBlobsLayer::Render calls ShowImageProcessor::UpdateLocation2BlobIndexIfNeeded, which calls Reset(), and then the layer calls location2blobIndex.Render().

As location2blobIndex (MinimalIndexer) Reset() is public, anyone can do this. This may be dangerous later.

ShowImageProcessor should call Reset, not the layer. The processor knows when its MinimalIndexere gets invalid.

(Alternatively, MinimalIndexerre should have a serializing critical section getter to prevent rendering from multiple threads at the same time.)