Skip to content

Commit 06a97de

Browse files
committed
2 parents 67add5b + fe5e3a4 commit 06a97de

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

Client/core/CNewsBrowser.cpp

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CNewsBrowser::CNewsBrowser()
2626
m_pWindow = NULL;
2727
m_pTabPanel = NULL;
2828
m_pButtonOK = NULL;
29+
m_pButtonNewsLink = NULL;
2930
}
3031

3132
////////////////////////////////////////////////////
@@ -199,31 +200,15 @@ void CNewsBrowser::CreateGUI()
199200
////////////////////////////////////////////////////
200201
void CNewsBrowser::DestroyGUI()
201202
{
202-
// Destroy
203-
for (uint i = 0; i < m_TabList.size(); i++)
204-
{
205-
CGUITab* pTab = m_TabList[i];
206-
if (pTab)
207-
delete pTab;
208-
}
209-
m_TabList.clear();
210-
for (uint i = 0; i < m_TabContentList.size(); i++)
211-
{
212-
CGUIWindow* pWindow = m_TabContentList[i];
213-
if (pWindow)
214-
{
215-
CGUIElement* m_pScrollPane = pWindow->GetParent();
216-
if (m_pScrollPane)
217-
{
218-
delete m_pScrollPane;
219-
}
220-
delete pWindow;
221-
}
222-
}
223-
m_TabContentList.clear();
224-
SAFE_DELETE(m_pTabPanel);
203+
// Clean up the main UI elements in reverse order of creation
204+
SAFE_DELETE(m_pTabPanel); // This will destroy all tabs and their children
225205
SAFE_DELETE(m_pButtonOK);
206+
SAFE_DELETE(m_pButtonNewsLink);
226207
SAFE_DELETE(m_pWindow);
208+
209+
// Clear the lists after the GUI objects are destroyed
210+
m_TabList.clear();
211+
m_TabContentList.clear();
227212
}
228213

229214
////////////////////////////////////////////////////

Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MTA San Andreas 1.x\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-09-05 13:26+0000\n"
11+
"POT-Creation-Date: 2025-09-10 23:59+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2808,12 +2808,12 @@ msgid ""
28082808
msgstr ""
28092809

28102810
#. Create the window
2811-
#: Client/core/CNewsBrowser.cpp:153
2811+
#: Client/core/CNewsBrowser.cpp:154
28122812
msgid "NEWS"
28132813
msgstr ""
28142814

28152815
#. News link
2816-
#: Client/core/CNewsBrowser.cpp:171 Client/core/CNewsBrowser.cpp:172
2816+
#: Client/core/CNewsBrowser.cpp:172 Client/core/CNewsBrowser.cpp:173
28172817
msgid "Visit latest news article"
28182818
msgstr ""
28192819

0 commit comments

Comments
 (0)