|
wxMaxima
|
Regression test for BTextCtrl::LastActive(), the "which text control gets the sidebar symbols?" tracking. More...
#include <wx/app.h>#include <wx/bitmap.h>#include <wx/dcmemory.h>#include <wx/frame.h>#include <wx/log.h>#include "BTextCtrl.h"#include "Configuration.h"#include <cstdlib>#include <unistd.h>#include <catch2/catch.hpp>Data Structures | |
| class | TestApp |
Functions | |
| wxDECLARE_APP (TestApp) | |
| SCENARIO ("A focused text control registers itself as the symbol target") | |
| SCENARIO ("A destroyed text control cannot stay the symbol target") | |
| int | main (int argc, char **argv) |
Regression test for BTextCtrl::LastActive(), the "which text control gets the sidebar symbols?" tracking.
It used to be a raw wxTextCtrl* inside Configuration and BTextCtrl's destructor could not unregister itself (the Configuration object dies first on some platforms, issue #2027) – so closing a wizard whose field had the focus left a dangling pointer that Worksheet::OnSidebarKey() would write into and SetFocus() on: a use-after-free. The tracking is now a wxWeakRef-backed static on BTextCtrl itself; this drives a real BTextCtrl and checks the reference nulls itself when the control is destroyed.