Skip to content
  • Dmitry Kazakov's avatar
    Fix a crash when cancelling Transform Tool action · 2dc2ed5f
    Dmitry Kazakov authored
    The crash happens only on systems that have asserts enabled, that
    is, don't have NDEBUG defined.
    
    Binding uninitialized '*m_savedTransformArgs' to a cont-reference
    generated valid c++ code (a reference initialized with nullptr),
    and given that finishStrokeImpl() didn't try to use/dereference
    this reference, the code worked fine and didn't crash on systems
    without asserts.
    
    But on systems with asserts enabled (non NDEBUG), boost::optional
    triggered a sanity check assert for dereferencing nullptr and crashed
    the application.
    
    The patch removes entire code for resetting m_savedTransformArgs in
    cancelStrokeCallback(). It was actually an artifact of some initial
    refactoring.
    
    Thanks Fredrik Hansson for pointing out the problem!
    https://invent.kde.org/kde/krita/merge_requests/197
    
    BUG:414672
    2dc2ed5f