mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fixed a file handle leak.
This commit is contained in:
parent
cf0697b5f2
commit
a0d47bf167
1 changed files with 9 additions and 11 deletions
|
@ -433,17 +433,15 @@ static std::string icon_name_respected_to_mode(const std::string& bmp_name_in)
|
||||||
#else
|
#else
|
||||||
const std::string folder = "white/";
|
const std::string folder = "white/";
|
||||||
#endif
|
#endif
|
||||||
std::string bmp_name = Slic3r::GUI::wxGetApp().dark_mode() ? folder + bmp_name_in : bmp_name_in;
|
std::string bmp_name;
|
||||||
|
if (Slic3r::GUI::wxGetApp().dark_mode()) {
|
||||||
|
bmp_name = folder + bmp_name_in;
|
||||||
boost::replace_last(bmp_name, ".png", "");
|
boost::replace_last(bmp_name, ".png", "");
|
||||||
FILE* fp = NULL;
|
}
|
||||||
fp = boost::nowide::fopen(Slic3r::var(bmp_name + ".svg").c_str(), "rb");
|
if (bmp_name.empty()) {
|
||||||
if (!fp)
|
|
||||||
{
|
|
||||||
bmp_name = bmp_name_in;
|
bmp_name = bmp_name_in;
|
||||||
boost::replace_last(bmp_name, ".png", "");
|
boost::replace_last(bmp_name, ".png", "");
|
||||||
if (fp) fclose(fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bmp_name;
|
return bmp_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue