mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
Qt: use unique_ptr for Ui objects. Should fix some mem-leaks
This commit is contained in:
parent
bb03e17e2d
commit
e9ba6fd034
17 changed files with 9 additions and 20 deletions
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "sys_sync.h"
|
#include "sys_sync.h"
|
||||||
#include "sys_event.h"
|
#include "sys_event.h"
|
||||||
#include "Utilities/Timer.h"
|
|
||||||
#include "Utilities/simple_ringbuf.h"
|
#include "Utilities/simple_ringbuf.h"
|
||||||
#include "Utilities/transactional_storage.h"
|
#include "Utilities/transactional_storage.h"
|
||||||
#include "Utilities/cond.h"
|
#include "Utilities/cond.h"
|
||||||
|
|
|
@ -25,5 +25,4 @@ about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_
|
||||||
|
|
||||||
about_dialog::~about_dialog()
|
about_dialog::~about_dialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,5 +16,5 @@ public:
|
||||||
~about_dialog();
|
~about_dialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::about_dialog *ui;
|
std::unique_ptr<Ui::about_dialog> ui;
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,6 @@ private:
|
||||||
void load_config();
|
void load_config();
|
||||||
void save_config();
|
void save_config();
|
||||||
|
|
||||||
Ui::camera_settings_dialog* ui;
|
std::unique_ptr<Ui::camera_settings_dialog> ui;
|
||||||
std::shared_ptr<QCamera> m_camera;
|
std::shared_ptr<QCamera> m_camera;
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,6 @@ main_window::main_window(std::shared_ptr<gui_settings> gui_settings, std::shared
|
||||||
main_window::~main_window()
|
main_window::~main_window()
|
||||||
{
|
{
|
||||||
SaveWindowState();
|
SaveWindowState();
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An init method is used so that RPCS3App can create the necessary connects before calling init (specifically the stylesheet connect).
|
/* An init method is used so that RPCS3App can create the necessary connects before calling init (specifically the stylesheet connect).
|
||||||
|
|
|
@ -42,7 +42,7 @@ class main_window : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Ui::main_window *ui;
|
std::unique_ptr<Ui::main_window> ui;
|
||||||
|
|
||||||
bool m_sys_menu_opened = false;
|
bool m_sys_menu_opened = false;
|
||||||
bool m_is_list_mode = true;
|
bool m_is_list_mode = true;
|
||||||
|
|
|
@ -71,7 +71,6 @@ pad_led_settings_dialog::pad_led_settings_dialog(QDialog* parent, int colorR, in
|
||||||
|
|
||||||
pad_led_settings_dialog::~pad_led_settings_dialog()
|
pad_led_settings_dialog::~pad_led_settings_dialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pad_led_settings_dialog::redraw_color_sample() const
|
void pad_led_settings_dialog::redraw_color_sample() const
|
||||||
|
|
|
@ -27,7 +27,7 @@ private Q_SLOTS:
|
||||||
private:
|
private:
|
||||||
void redraw_color_sample() const;
|
void redraw_color_sample() const;
|
||||||
void read_form_values();
|
void read_form_values();
|
||||||
Ui::pad_led_settings_dialog *ui;
|
std::unique_ptr<Ui::pad_led_settings_dialog> ui;
|
||||||
struct led_settings
|
struct led_settings
|
||||||
{
|
{
|
||||||
int cR = 255;
|
int cR = 255;
|
||||||
|
|
|
@ -208,8 +208,6 @@ pad_settings_dialog::~pad_settings_dialog()
|
||||||
{
|
{
|
||||||
m_gui_settings->SetValue(gui::pads_geometry, saveGeometry());
|
m_gui_settings->SetValue(gui::pads_geometry, saveGeometry());
|
||||||
|
|
||||||
delete ui;
|
|
||||||
|
|
||||||
if (!Emu.IsStopped())
|
if (!Emu.IsStopped())
|
||||||
{
|
{
|
||||||
pad::reset(Emu.GetTitleID());
|
pad::reset(Emu.GetTitleID());
|
||||||
|
|
|
@ -108,7 +108,7 @@ private Q_SLOTS:
|
||||||
void ApplyCurrentPlayerConfig(int new_player_id);
|
void ApplyCurrentPlayerConfig(int new_player_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::pad_settings_dialog *ui;
|
std::unique_ptr<Ui::pad_settings_dialog> ui;
|
||||||
std::string m_title_id;
|
std::string m_title_id;
|
||||||
std::shared_ptr<gui_settings> m_gui_settings;
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
~patch_creator_dialog();
|
~patch_creator_dialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::patch_creator_dialog* ui;
|
std::unique_ptr<Ui::patch_creator_dialog> ui;
|
||||||
QFont mMonoFont;
|
QFont mMonoFont;
|
||||||
QColor mValidColor;
|
QColor mValidColor;
|
||||||
QColor mInvalidColor;
|
QColor mInvalidColor;
|
||||||
|
|
|
@ -127,8 +127,6 @@ patch_manager_dialog::~patch_manager_dialog()
|
||||||
// Save gui settings
|
// Save gui settings
|
||||||
m_gui_settings->SetValue(gui::pm_geometry, saveGeometry());
|
m_gui_settings->SetValue(gui::pm_geometry, saveGeometry());
|
||||||
m_gui_settings->SetValue(gui::pm_splitter_state, ui->splitter->saveState());
|
m_gui_settings->SetValue(gui::pm_splitter_state, ui->splitter->saveState());
|
||||||
|
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int patch_manager_dialog::exec()
|
int patch_manager_dialog::exec()
|
||||||
|
|
|
@ -73,7 +73,7 @@ private:
|
||||||
bool m_download_automatic = false;
|
bool m_download_automatic = false;
|
||||||
bool m_download_auto_accept = false;
|
bool m_download_auto_accept = false;
|
||||||
|
|
||||||
Ui::patch_manager_dialog *ui;
|
std::unique_ptr<Ui::patch_manager_dialog> ui;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void dropEvent(QDropEvent* event) override;
|
void dropEvent(QDropEvent* event) override;
|
||||||
|
|
|
@ -2126,8 +2126,6 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
settings_dialog::~settings_dialog()
|
settings_dialog::~settings_dialog()
|
||||||
{
|
{
|
||||||
m_gui_settings->SetValue(gui::cfg_geometry, saveGeometry());
|
m_gui_settings->SetValue(gui::cfg_geometry, saveGeometry());
|
||||||
|
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings_dialog::EnhanceSlider(emu_settings_type settings_type, QSlider* slider, QLabel* label, const QString& label_text) const
|
void settings_dialog::EnhanceSlider(emu_settings_type settings_type, QSlider* slider, QLabel* label, const QString& label_text) const
|
||||||
|
|
|
@ -47,7 +47,7 @@ private:
|
||||||
std::array<QComboBox*, 4> m_mics_combo;
|
std::array<QComboBox*, 4> m_mics_combo;
|
||||||
|
|
||||||
int m_tab_index;
|
int m_tab_index;
|
||||||
Ui::settings_dialog *ui;
|
std::unique_ptr<Ui::settings_dialog> ui;
|
||||||
std::shared_ptr<gui_settings> m_gui_settings;
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
std::shared_ptr<emu_settings> m_emu_settings;
|
std::shared_ptr<emu_settings> m_emu_settings;
|
||||||
|
|
||||||
|
|
|
@ -36,5 +36,4 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, QWidg
|
||||||
|
|
||||||
welcome_dialog::~welcome_dialog()
|
welcome_dialog::~welcome_dialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,6 @@ public:
|
||||||
~welcome_dialog();
|
~welcome_dialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::welcome_dialog *ui;
|
std::unique_ptr<Ui::welcome_dialog> ui;
|
||||||
std::shared_ptr<gui_settings> m_gui_settings;
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue