openDsh / dash

Join us on Slack! https://join.slack.com/t/opendsh/shared_invite/zt-la398uly-a6eMH5ttEQhbtE6asVKx4Q
GNU General Public License v3.0
238 stars 69 forks source link

"free(): invalid pointer" and abnormal termination on shutdown #69

Open stefan-sherwood opened 3 years ago

stefan-sherwood commented 3 years ago

class Config is constructed with QApplication as its parent (in src/app/config.cpp).

Config::Config()
    : QObject(qApp),

but it is instantiated on the stack

Config *Config::get_instance()
{
    static Config config;
    return &config;
}

On shutdown, QApplication calls free() on all of its children, including the instance of Config. This causes an abnormal program termination on every shutdown.

rsjudka commented 3 years ago

yeah Config was actually supposed to go away on my last major rework, but there were some open PRs still using it so I decided to leave it for now

Once I get to cleaning that up, it'll be gone 😄

rsjudka commented 3 years ago

there's also a bug in the OA lib when you shut down, so I've also been a bit more laxed on a clean dash shutdown for now :p