wxGTK: Fix wxTextCtrl crash with GSpell attached The logic in wxTextCtrl::DoFreeze() for deleting leaked anonymous marks when detaching the buffer kept raw pointers to GtkTextMark objects without managing their reference count. This worked for the specific internal mark targeted by this code, but broke with other marks that may have become invalid in the meantime. Specifically, GSpell uses such marks internally too, causing a use-after-free crash. Fixed by ref-counting the objects kept in m_anonymousMarkList. Closes #26464.
Update Poedit links Update links to Poedit in the docs, plus adjacent things things such as the name or current path to xgettext. Closes #26465.
Fix reusing wxOverlay after resetting it in wxMSW This notably fixes user-visible problems when splitting wxAuiNotebook in multiple panes. See #26455. Closes #26251.
| ... | ... | @@ -10,8 +10,8 @@ First of all, here is what you will need: |
| 10 | 10 | - For Unix systems you can download gettext-0.xx.yy.tar.gz from any GNU
|
| 11 | 11 | mirror (RPMs and DEBs are also available from the usual places)
|
| 12 | 12 | - For Windows you can download the precompiled binaries from
|
| 13 | - www.wxwidgets.org or install [Poedit](https://poedit.net/) and add
|
|
| 14 | - `<installdir>/poEdit/bin` to your path (so it can find xgettext).
|
|
| 13 | + www.wxwidgets.org or install [Poedit](https://poedit.com/) and add
|
|
| 14 | + `<installdir>/Poedit/GettextTools/bin` to your path (so it can find xgettext).
|
|
| 15 | 15 | |
| 16 | 16 | 2. A way to run a program recursively on an entire directory from the command
|
| 17 | 17 | line:
|
| ... | ... | @@ -459,7 +459,7 @@ Here are the steps you should follow: |
| 459 | 459 | for your language. Initialization can be also done using e.g. Poedit (see next item).
|
| 460 | 460 | -# Translate the strings in this file using either your favourite text
|
| 461 | 461 | editor or a specialized tool such as Vaclav Slavik's excellent
|
| 462 | - <a href="http://www.poedit.net/">poEdit</a> utility.
|
|
| 462 | + <a href="http://www.poedit.com/">Poedit</a> utility.
|
|
| 463 | 463 | -# Verify that your translations can at least be compiled (even if they
|
| 464 | 464 | are yet incomplete) by running <tt>msgfmt -vc XY.po</tt> command:
|
| 465 | 465 | please note that you <i>must</i> use the <tt>-c</tt> option. In
|
| ... | ... | @@ -26,7 +26,7 @@ The wxWidgets approach to i18n closely follows the GNU gettext package. |
| 26 | 26 | wxWidgets uses the message catalogs which are binary compatible with gettext
|
| 27 | 27 | catalogs and this allows to use all of the programs in this package to work
|
| 28 | 28 | with them as well as using any of the tools working with message catalogs in
|
| 29 | -this format such as <a href="http://poedit.net/">Poedit</a>.
|
|
| 29 | +this format such as <a href="http://poedit.com/">Poedit</a>.
|
|
| 30 | 30 | |
| 31 | 31 | Because of this, you will need to use the gettext package to work with the
|
| 32 | 32 | translations during the program development. However no additional libraries
|
| ... | ... | @@ -654,7 +654,7 @@ extern "C" { |
| 654 | 654 | static void mark_set(GtkTextBuffer*, GtkTextIter*, GtkTextMark* mark, GSList** markList)
|
| 655 | 655 | {
|
| 656 | 656 | if (gtk_text_mark_get_name(mark) == nullptr)
|
| 657 | - *markList = g_slist_prepend(*markList, mark);
|
|
| 657 | + *markList = g_slist_prepend(*markList, g_object_ref(mark));
|
|
| 658 | 658 | }
|
| 659 | 659 | }
|
| 660 | 660 | |
| ... | ... | @@ -730,7 +730,7 @@ wxTextCtrl::~wxTextCtrl() |
| 730 | 730 | Thaw();
|
| 731 | 731 | |
| 732 | 732 | if (m_anonymousMarkList)
|
| 733 | - g_slist_free(m_anonymousMarkList);
|
|
| 733 | + g_slist_free_full(m_anonymousMarkList, g_object_unref);
|
|
| 734 | 734 | if (m_afterLayoutId)
|
| 735 | 735 | g_source_remove(m_afterLayoutId);
|
| 736 | 736 | }
|
| ... | ... | @@ -2339,7 +2339,7 @@ void wxTextCtrl::DoFreeze() |
| 2339 | 2339 | if (GTK_IS_TEXT_MARK(mark) && !gtk_text_mark_get_deleted(mark))
|
| 2340 | 2340 | gtk_text_buffer_delete_mark(m_buffer, mark);
|
| 2341 | 2341 | }
|
| 2342 | - g_slist_free(m_anonymousMarkList);
|
|
| 2342 | + g_slist_free_full(m_anonymousMarkList, g_object_unref);
|
|
| 2343 | 2343 | m_anonymousMarkList = nullptr;
|
| 2344 | 2344 | }
|
| 2345 | 2345 | }
|
| ... | ... | @@ -259,6 +259,10 @@ void wxOverlayImpl::Reset() |
| 259 | 259 | m_overlayWindow = nullptr;
|
| 260 | 260 | |
| 261 | 261 | m_alpha = wxALPHA_OPAQUE;
|
| 262 | + |
|
| 263 | + // Reset any clipping set on this memory DC which would affect any
|
|
| 264 | + // drawing performed the next time this wxOverlay object is reused.
|
|
| 265 | + ::SelectClipRgn(GetHdcOf(m_memDC), 0);
|
|
| 262 | 266 | }
|
| 263 | 267 | }
|
| 264 | 268 |
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help