ENH: call Bambu source deinit
Change-Id: I7b96056aabe7a894c66fcaf61e24f783f5a1e217 Jira: STUDIO-7666
This commit is contained in:
parent
570751668e
commit
9f85798a0b
|
@ -147,6 +147,7 @@ namespace pt = boost::property_tree;
|
||||||
struct StaticBambuLib
|
struct StaticBambuLib
|
||||||
{
|
{
|
||||||
static void reset();
|
static void reset();
|
||||||
|
static void release();
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
@ -2240,6 +2241,8 @@ GUI_App::~GUI_App()
|
||||||
delete preset_updater;
|
delete preset_updater;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StaticBambuLib::release();
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": exit");
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -771,10 +771,7 @@ void MediaPlayCtrl::media_proc()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
if (url.IsEmpty()) {
|
if (url == "<stop>") {
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (url == "<stop>") {
|
|
||||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: start stop";
|
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: start stop";
|
||||||
m_media_ctrl->Stop();
|
m_media_ctrl->Stop();
|
||||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: end stop";
|
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: end stop";
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct StaticBambuLib : BambuLib {
|
||||||
static StaticBambuLib &get(BambuLib * copy = nullptr);
|
static StaticBambuLib &get(BambuLib * copy = nullptr);
|
||||||
static int Fake_Bambu_Create(Bambu_Tunnel*, char const*) { return -2; }
|
static int Fake_Bambu_Create(Bambu_Tunnel*, char const*) { return -2; }
|
||||||
static void reset();
|
static void reset();
|
||||||
|
static void release();
|
||||||
private:
|
private:
|
||||||
std::vector<BambuLib *> copies_;
|
std::vector<BambuLib *> copies_;
|
||||||
};
|
};
|
||||||
|
@ -1645,6 +1646,7 @@ StaticBambuLib &StaticBambuLib::get(BambuLib *copy)
|
||||||
GET_FUNC(Bambu_Destroy);
|
GET_FUNC(Bambu_Destroy);
|
||||||
GET_FUNC(Bambu_SetLogger);
|
GET_FUNC(Bambu_SetLogger);
|
||||||
GET_FUNC(Bambu_FreeLogMsg);
|
GET_FUNC(Bambu_FreeLogMsg);
|
||||||
|
GET_FUNC(Bambu_Deinit);
|
||||||
|
|
||||||
if (!lib.Bambu_Create) {
|
if (!lib.Bambu_Create) {
|
||||||
lib.Bambu_Create = Fake_Bambu_Create;
|
lib.Bambu_Create = Fake_Bambu_Create;
|
||||||
|
@ -1662,6 +1664,12 @@ void StaticBambuLib::reset()
|
||||||
*c = lib;
|
*c = lib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StaticBambuLib::release()
|
||||||
|
{
|
||||||
|
if (auto f = get().Bambu_Deinit)
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" BambuLib *bambulib_get() {
|
extern "C" BambuLib *bambulib_get() {
|
||||||
return &StaticBambuLib::get();
|
return &StaticBambuLib::get();
|
||||||
}
|
}
|
Loading…
Reference in New Issue