G'day,
As mentioned in the previous message, here's another change, almost
identical in nature to Part 1, that handles cleanup/discarding of
temporary resources when an image operation is cancelled.
It gets rid of another "-Wmisleading-indentation" warning from the
gcc 6.4.0 compiler I'm running.
The "-MODIFIED-" moniker in the filename indicates that the baseline
for this patch is the output of the Part 1 patch, posted previously.
Again, I've tried to be fairly conservative and non-controversial
in these changes, so hopefully they're more palatable.
All the changes hinge on the property of the system function free(3),
that it explicitly does nothing if handed a NULL pointer
(standardised ever since ANSI C, 1989), and its' simpler code on the
caller side (and very little CPU overhead) to exploit this.
Hope this is also useful,
cheers,
sur-behoffski etc etc etc
--- src/process/im_analyze.cpp 2017-12-15 17:35:21.284559742 +1030
+++ src/process/im_analyze-part2.cpp 2017-12-15 17:16:35.574448672 +1030
@@ -811,17 +811,17 @@
if (!imCounterInc(counter))
{
- if (local_major_slope) free(local_major_slope);
- if (local_minor_slope) free(local_minor_slope);
+ free(local_major_slope);
+ free(local_minor_slope);
free(A1);
free(A2);
free(C1);
free(C2);
- if (local_data_area) free(local_data_area);
- if (local_data_cx) free(local_data_cx);
- if (local_data_cy) free(local_data_cy);
- if (cm20) free(cm20); if (cm02) free(cm02); if (cm11) free(cm11);
+ free(local_data_area);
+ free(local_data_cx);
+ free(local_data_cy);
+ free(cm20); free(cm02); free(cm11);
imProcessCounterEnd(counter);
return 0;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users