Make mruby raii cleanup, and fix cleanup bug.
- Functions were cleaned up after mruby, which was wrong. - Becuase functions could have stored a reference to a Block which refers to mruby. - And so it would crash on release builds at exit if custom functions were used.
This commit is contained in:
+1
-3
@@ -14,6 +14,7 @@
|
||||
|
||||
namespace bed {
|
||||
struct BEd {
|
||||
internal::scripting::RubyState mrb;
|
||||
internal::trie::Trie<internal::functions::Function> functions;
|
||||
internal::functions::Function no_op;
|
||||
internal::functions::Function eof_op;
|
||||
@@ -24,9 +25,6 @@ struct BEd {
|
||||
internal::vase::AppendStorage append{"/tmp"};
|
||||
std::unordered_map<std::string, internal::buffer::Buffer *> buffers;
|
||||
|
||||
mrb_state *mrb = nullptr;
|
||||
int arena;
|
||||
|
||||
bool help_mode = false;
|
||||
bool prompt_mode = true;
|
||||
std::function<std::string(BEd &)> prompt = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user