diff --git a/src/ccutil/elst.cpp b/src/ccutil/elst.cpp index 3d74359068..36f2cf4684 100644 --- a/src/ccutil/elst.cpp +++ b/src/ccutil/elst.cpp @@ -210,11 +210,13 @@ ELIST_LINK *ELIST_ITERATOR::forward() { cycle_pt = next; current = next; } +#ifndef NDEBUG + if (!current) + NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr); +#endif next = current->next; #ifndef NDEBUG - if (!current) - NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr); if (!next) NULL_NEXT.error ("ELIST_ITERATOR::forward", ABORT, "This is: %p Current is: %p", this, current); diff --git a/src/training/stringrenderer.cpp b/src/training/stringrenderer.cpp index 74fb004b35..2e4e9b5b96 100644 --- a/src/training/stringrenderer.cpp +++ b/src/training/stringrenderer.cpp @@ -90,7 +90,8 @@ Pix* CairoARGB32ToPixFormat(cairo_surface_t *surface) { StringRenderer::StringRenderer(const std::string& font_desc, int page_width, int page_height) - : page_width_(page_width), + : font_(font_desc), + page_width_(page_width), page_height_(page_height), h_margin_(50), v_margin_(50), @@ -118,7 +119,6 @@ StringRenderer::StringRenderer(const std::string& font_desc, int page_width, total_chars_(0), font_index_(0), last_offset_(0) { - set_font(font_desc); set_resolution(kDefaultOutputResolution); } diff --git a/src/viewer/svutil.cpp b/src/viewer/svutil.cpp index 3868bc76e4..99de09581f 100644 --- a/src/viewer/svutil.cpp +++ b/src/viewer/svutil.cpp @@ -279,6 +279,8 @@ void SVNetwork::Close() { #else close(stream_); #endif + // Mark stream_ as invalid. + stream_ = -1; } @@ -448,6 +450,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) { } SVNetwork::~SVNetwork() { + Close(); delete[] msg_buffer_in_; }