aboutsummaryrefslogtreecommitdiff
path: root/src/Gif.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gif.cpp')
-rw-r--r--src/Gif.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/Gif.cpp b/src/Gif.cpp
index 6b38f10..7a80f86 100644
--- a/src/Gif.cpp
+++ b/src/Gif.cpp
@@ -66,7 +66,16 @@ namespace dchat
{
throw GifLoadException(e.what());
}
- init();
+
+ try
+ {
+ init();
+ }
+ catch(GifLoadException &e)
+ {
+ delete fileContent.data;
+ throw e;
+ }
}
Gif::Gif(StringView &&_fileContent) :
@@ -74,7 +83,15 @@ namespace dchat
currentFrame(0),
timeElapsedCs(0.0)
{
- init();
+ try
+ {
+ init();
+ }
+ catch(GifLoadException &e)
+ {
+ delete fileContent.data;
+ throw e;
+ }
}
void Gif::init()