Fix the random crash at the startup on Macos&&Linux

don't do the post_init when adding script handler of webview

Change-Id: I2c766c46bb67347286765dee539657b5efd7f64a
This commit is contained in:
lane.wei 2022-10-09 09:40:38 +08:00 committed by Lane.Wei
parent 3dbdc40360
commit c6f0c41213
3 changed files with 9 additions and 1 deletions

View file

@ -269,6 +269,8 @@ private:
boost::thread m_sync_update_thread;
bool enable_sync = false;
bool m_adding_script_handler { false };
public:
bool OnInit() override;
bool initialized() const { return m_initialized; }
@ -458,6 +460,8 @@ public:
//BBS
void load_url(wxString url);
void run_script(wxString js);
bool is_adding_script_handler() { return m_adding_script_handler; }
void set_adding_script_handler(bool status) { m_adding_script_handler = status; }
// Parameters extracted from the command line to be passed to GUI after initialization.
GUI_InitParams* init_params { nullptr };