summaryrefslogtreecommitdiff
path: root/src/compat/option.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-10-18 13:58:19 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-10-18 14:23:21 -0700
commitd7e5119b4c64a960ae66fdc0478e9658c9ebbf63 (patch)
tree2bc4f78a33c449272fffc94e21dbca9b5ce4ae03 /src/compat/option.hpp
parent8eea85618c4a070fda6257f2be5280f9684c93c6 (diff)
downloadtmwa-d7e5119b4c64a960ae66fdc0478e9658c9ebbf63.tar.gz
tmwa-d7e5119b4c64a960ae66fdc0478e9658c9ebbf63.tar.bz2
tmwa-d7e5119b4c64a960ae66fdc0478e9658c9ebbf63.tar.xz
tmwa-d7e5119b4c64a960ae66fdc0478e9658c9ebbf63.zip
Fix bug where Option destroys too much
Diffstat (limited to 'src/compat/option.hpp')
-rw-r--r--src/compat/option.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compat/option.hpp b/src/compat/option.hpp
index 27ee0bc..1976589 100644
--- a/src/compat/option.hpp
+++ b/src/compat/option.hpp
@@ -171,7 +171,10 @@ namespace option
}
~Option()
{
- do_destruct();
+ if (repr.is_some())
+ {
+ do_destruct();
+ }
}
T move_or(T def)