Fix for some memory leaks issue #657
This commit is contained in:
parent
c109330c53
commit
fbb9cff8ee
@ -513,6 +513,7 @@ template<class T> void bilateral (T** src, T** dst, int W, int H, int sigmar, do
|
|||||||
delete [] rhist;
|
delete [] rhist;
|
||||||
for (int i=0; i<H; i++)
|
for (int i=0; i<H; i++)
|
||||||
delete [] buff_final[i];
|
delete [] buff_final[i];
|
||||||
|
delete [] buff_final;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,9 +119,9 @@ ImageIO::~ImageIO () {
|
|||||||
|
|
||||||
if (embProfile)
|
if (embProfile)
|
||||||
cmsCloseProfile(embProfile);
|
cmsCloseProfile(embProfile);
|
||||||
delete loadedProfileData;
|
delete [] loadedProfileData;
|
||||||
delete exifRoot;
|
delete exifRoot;
|
||||||
delete profileData;
|
delete [] profileData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void png_read_data(png_struct_def *png_ptr, unsigned char *data, size_t length);
|
void png_read_data(png_struct_def *png_ptr, unsigned char *data, size_t length);
|
||||||
@ -278,9 +278,11 @@ int ImageIO::loadJPEGFromMemory (const char* buffer, int bufsize)
|
|||||||
//jpeg_memory_src (&cinfo,buffer,bufsize);
|
//jpeg_memory_src (&cinfo,buffer,bufsize);
|
||||||
jpeg_read_header(&cinfo, TRUE);
|
jpeg_read_header(&cinfo, TRUE);
|
||||||
|
|
||||||
unsigned int proflen;
|
unsigned int proflen;
|
||||||
delete loadedProfileData;
|
if( loadedProfileData ){
|
||||||
loadedProfileData = NULL;
|
delete [] loadedProfileData;
|
||||||
|
loadedProfileData = NULL;
|
||||||
|
}
|
||||||
bool hasprofile = read_icc_profile (&cinfo, (JOCTET**)&loadedProfileData, (unsigned int*)&loadedProfileLength);
|
bool hasprofile = read_icc_profile (&cinfo, (JOCTET**)&loadedProfileData, (unsigned int*)&loadedProfileLength);
|
||||||
if (hasprofile)
|
if (hasprofile)
|
||||||
embProfile = cmsOpenProfileFromMem (loadedProfileData, loadedProfileLength);
|
embProfile = cmsOpenProfileFromMem (loadedProfileData, loadedProfileLength);
|
||||||
@ -434,8 +436,10 @@ int ImageIO::loadTIFF (Glib::ustring fname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char* profdata;
|
char* profdata;
|
||||||
delete loadedProfileData;
|
if( loadedProfileData ){
|
||||||
loadedProfileData = NULL;
|
delete [] loadedProfileData;
|
||||||
|
loadedProfileData = NULL;
|
||||||
|
}
|
||||||
if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &loadedProfileLength, &profdata)) {
|
if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &loadedProfileLength, &profdata)) {
|
||||||
embProfile = cmsOpenProfileFromMem (profdata, loadedProfileLength);
|
embProfile = cmsOpenProfileFromMem (profdata, loadedProfileLength);
|
||||||
loadedProfileData = new char [loadedProfileLength];
|
loadedProfileData = new char [loadedProfileLength];
|
||||||
|
@ -97,9 +97,9 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd
|
|||||||
subGroup = ceSubGroup;
|
subGroup = ceSubGroup;
|
||||||
|
|
||||||
if (group && text.size())
|
if (group && text.size())
|
||||||
curveType = Gtk::manage (new PopUpToggleButton(text + ":"));
|
curveType = new PopUpToggleButton(text + ":");
|
||||||
else
|
else
|
||||||
curveType = Gtk::manage (new PopUpToggleButton());
|
curveType = new PopUpToggleButton();
|
||||||
|
|
||||||
curveType->set_tooltip_text(M("CURVEEDITOR_TYPE"));
|
curveType->set_tooltip_text(M("CURVEEDITOR_TYPE"));
|
||||||
// TODO: Does this signal have to be blocked when on curve type change ?
|
// TODO: Does this signal have to be blocked when on curve type change ?
|
||||||
@ -108,7 +108,7 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd
|
|||||||
}
|
}
|
||||||
|
|
||||||
CurveEditor::~CurveEditor () {
|
CurveEditor::~CurveEditor () {
|
||||||
|
delete curveType;
|
||||||
delete [] histogram;
|
delete [] histogram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb) : selectedDirectoryId(1)
|
|||||||
inTabMode=false;
|
inTabMode=false;
|
||||||
|
|
||||||
// construct and initialize thumbnail browsers
|
// construct and initialize thumbnail browsers
|
||||||
fileBrowser = new FileBrowser();
|
fileBrowser = Gtk::manage( new FileBrowser() );
|
||||||
fileBrowser->setFileBrowserListener (this);
|
fileBrowser->setFileBrowserListener (this);
|
||||||
fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical);
|
fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical);
|
||||||
fileBrowser->show ();
|
fileBrowser->show ();
|
||||||
|
@ -36,9 +36,9 @@ FilePanel::FilePanel () : parent(NULL) {
|
|||||||
dirpaned = Gtk::manage ( new Gtk::HPaned () );
|
dirpaned = Gtk::manage ( new Gtk::HPaned () );
|
||||||
dirpaned->set_position (options.dirBrowserWidth);
|
dirpaned->set_position (options.dirBrowserWidth);
|
||||||
|
|
||||||
dirBrowser = new DirBrowser ();
|
dirBrowser = Gtk::manage ( new DirBrowser () );
|
||||||
placesBrowser = new PlacesBrowser ();
|
placesBrowser = Gtk::manage ( new PlacesBrowser () );
|
||||||
recentBrowser = new RecentBrowser ();
|
recentBrowser = Gtk::manage ( new RecentBrowser () );
|
||||||
|
|
||||||
placespaned = Gtk::manage ( new Gtk::VPaned () );
|
placespaned = Gtk::manage ( new Gtk::VPaned () );
|
||||||
placespaned->set_size_request(50,100);
|
placespaned->set_size_request(50,100);
|
||||||
@ -54,7 +54,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
|||||||
dirpaned->pack1 (*placespaned, false, true);
|
dirpaned->pack1 (*placespaned, false, true);
|
||||||
|
|
||||||
tpc = new BatchToolPanelCoordinator (this);
|
tpc = new BatchToolPanelCoordinator (this);
|
||||||
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
|
fileCatalog = Gtk::manage ( new FileCatalog (tpc->coarse, tpc->getToolBar()) );
|
||||||
ribbonPane = Gtk::manage ( new Gtk::Paned() );
|
ribbonPane = Gtk::manage ( new Gtk::Paned() );
|
||||||
ribbonPane->add(*fileCatalog);
|
ribbonPane->add(*fileCatalog);
|
||||||
ribbonPane->set_size_request(50,150);
|
ribbonPane->set_size_request(50,150);
|
||||||
@ -72,7 +72,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
|||||||
rightNotebook = Gtk::manage ( new Gtk::Notebook () );
|
rightNotebook = Gtk::manage ( new Gtk::Notebook () );
|
||||||
//Gtk::VBox* taggingBox = Gtk::manage ( new Gtk::VBox () );
|
//Gtk::VBox* taggingBox = Gtk::manage ( new Gtk::VBox () );
|
||||||
|
|
||||||
history = new History (false);
|
history = Gtk::manage ( new History (false) );
|
||||||
|
|
||||||
tpc->addPParamsChangeListener (history);
|
tpc->addPParamsChangeListener (history);
|
||||||
history->setProfileChangeListener (tpc);
|
history->setProfileChangeListener (tpc);
|
||||||
|
@ -61,6 +61,7 @@ PopUpCommon::~PopUpCommon () {
|
|||||||
}
|
}
|
||||||
if (menu) delete menu;
|
if (menu) delete menu;
|
||||||
if (buttonImage) delete buttonImage;
|
if (buttonImage) delete buttonImage;
|
||||||
|
delete buttonGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
PopUpCommon::type_signal_changed PopUpCommon::signal_changed() {
|
PopUpCommon::type_signal_changed PopUpCommon::signal_changed() {
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
Gtk::HBox* buttonGroup; // this is the widget to be packed
|
Gtk::HBox* buttonGroup; // this is the widget to be packed
|
||||||
|
|
||||||
PopUpCommon (Gtk::Button* button, const Glib::ustring& label = "");
|
PopUpCommon (Gtk::Button* button, const Glib::ustring& label = "");
|
||||||
~PopUpCommon ();
|
virtual ~PopUpCommon ();
|
||||||
bool addEntry (Glib::ustring imagePath, Glib::ustring label);
|
bool addEntry (Glib::ustring imagePath, Glib::ustring label);
|
||||||
bool setSelected (int entryNum);
|
bool setSelected (int entryNum);
|
||||||
int getSelected () { return selected; }
|
int getSelected () { return selected; }
|
||||||
|
@ -28,7 +28,7 @@ SaveFormatPanel::SaveFormatPanel () : listener (NULL) {
|
|||||||
pngcompr = new Adjuster (M("SAVEDLG_PNGCOMPR"), 0, 6, 1, 6);
|
pngcompr = new Adjuster (M("SAVEDLG_PNGCOMPR"), 0, 6, 1, 6);
|
||||||
pngcompr->setAdjusterListener (this);
|
pngcompr->setAdjusterListener (this);
|
||||||
pngcompr->show ();
|
pngcompr->show ();
|
||||||
tiffuncompressed = Gtk::manage (new Gtk::CheckButton (M("SAVEDLG_TIFFUNCOMPRESSED")));
|
tiffuncompressed = new Gtk::CheckButton (M("SAVEDLG_TIFFUNCOMPRESSED"));
|
||||||
tiffuncompressed->signal_toggled().connect( sigc::mem_fun(*this,&SaveFormatPanel::formatChanged));
|
tiffuncompressed->signal_toggled().connect( sigc::mem_fun(*this,&SaveFormatPanel::formatChanged));
|
||||||
tiffuncompressed->show();
|
tiffuncompressed->show();
|
||||||
|
|
||||||
@ -64,6 +64,12 @@ SaveFormatPanel::SaveFormatPanel () : listener (NULL) {
|
|||||||
fstr[3] = "png";
|
fstr[3] = "png";
|
||||||
fstr[4] = "png";
|
fstr[4] = "png";
|
||||||
}
|
}
|
||||||
|
SaveFormatPanel::~SaveFormatPanel ()
|
||||||
|
{
|
||||||
|
delete jpegqual;
|
||||||
|
delete pngcompr;
|
||||||
|
delete tiffuncompressed;
|
||||||
|
}
|
||||||
|
|
||||||
void SaveFormatPanel::init (SaveFormat &sf) {
|
void SaveFormatPanel::init (SaveFormat &sf) {
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class SaveFormatPanel : public Gtk::VBox, public AdjusterListener {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
SaveFormatPanel ();
|
SaveFormatPanel ();
|
||||||
|
~SaveFormatPanel ();
|
||||||
void setListener (FormatChangeListener* l) { listener = l; }
|
void setListener (FormatChangeListener* l) { listener = l; }
|
||||||
|
|
||||||
void init (SaveFormat& sf);
|
void init (SaveFormat& sf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user