1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-13 19:42:08 +00:00
serenity/Applications
Ben Wiederhake c9bafa9467 FontEditor: Cannot take reference to local lambda
Under the hood, a lambda is just a struct full of pointers/references/copies and whatever else
the compiler deems necessary. In the case of 'update_demo', the struct lives on the stack
frame of FontEditorWidget::FontEditorWidget(). Hence it is still alive when it's called
during the constructor.

However, when 'fixed_width_checkbox.on_checked' fires, that stack frame is no longer alive,
and thus the *reference* to the (struct of) the lambda is invalid\! This meant that
'update_demo' silently read invalid data, tried to call '.update()' on some innocent arbitrary
memory address, and it crashed somewhere unrelated.

Passing 'update_demo' by value (like with all the other event handlers) fixes this issue.
Note that this solution only works because 'update_demo' itself has no state; otherwise
the various copies of 'update_demo' might notice that they are, in fact, independent copies
of the original lambda. But that doesn't matter here.
2020-08-30 10:31:04 +02:00
..
About LibGUI: Make GUI::Application a Core::Object 2020-07-04 14:05:57 +02:00
Browser Browser: Mark default action in context menu of hyperlinks 2020-08-30 09:47:49 +02:00
Calculator Applications: Stop setting initial window location 2020-08-01 08:06:48 +02:00
Calendar LibGUI+Calendar: Make Calendar a common widget in LibGUI 2020-08-22 11:54:30 +02:00
Debugger LibDebug: Move everything into the "Debug" namespace 2020-08-25 09:46:06 +02:00
DisplaySettings DisplaySettings+LibGUI: Move ItemListModel into LibGUI 2020-08-29 17:42:03 +02:00
FileManager FileManager: Make DirectoryView vend indexes from view model 2020-08-17 22:49:52 +02:00
FontEditor FontEditor: Cannot take reference to local lambda 2020-08-30 10:31:04 +02:00
Help LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
HexEditor Applications: Stop setting initial window location 2020-08-01 08:06:48 +02:00
IRCClient IRCClient: Unbreak building with extra debug macros 2020-08-30 09:43:49 +02:00
KeyboardMapper Unicode: Try s/codepoint/code_point/g again 2020-08-05 22:33:42 +02:00
KeyboardSettings LibGUI: Move GUI::Model::Role to GUI::ModelRole 2020-08-16 16:44:09 +02:00
Piano Meta: Force semi-colon after MAKE_AK_NONXXXABLE() 2020-08-27 10:12:04 +02:00
PixelPaint Base: Rename icon subdirectories by explicit app name 2020-08-27 15:38:02 +02:00
QuickShow QuickShow: Disown child process after spawning 2020-08-04 18:17:16 +02:00
SoundPlayer SoundPlayer: Uninitialized variable in SoundPlayerWidget, found by Coverity 2020-08-17 09:17:57 +02:00
Spreadsheet Spreadsheet: Add (limited) support for custom cell formatting 2020-08-29 17:42:03 +02:00
SystemMonitor Base: Move 16x16 common icons to /res/icons/16x16/ 2020-08-27 15:38:02 +02:00
Terminal Base: Move 16x16 common icons to /res/icons/16x16/ 2020-08-27 15:38:02 +02:00
TextEditor LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
ThemeEditor ThemeEditor: Paint the minimize/maximize/close window button icons 2020-08-23 15:02:44 +02:00
Welcome Base: Rename Pebbleton to reflect actual height 2020-08-16 19:38:21 +02:00
CMakeLists.txt ChessEngine: Move from Applications to Services 2020-08-28 12:53:02 +02:00