File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1818template  <class  interpreter_type >
1919static  interpreter_type* builder_with_args (emscripten::val js_args)
2020{
21+     //  TODO: Refactor interpreter constructor to avoid static args-to-argv conversion.
2122    static  std::vector<std::string> args = emscripten::vecFromJSArray<std::string>(js_args);
2223    static  std::vector<const  char *> argv_vec;
2324
@@ -29,7 +30,10 @@ static interpreter_type* builder_with_args(emscripten::val js_args)
2930    int  argc = static_cast <int >(argv_vec.size ());
3031    char ** argv = const_cast <char **>(argv_vec.data ());
3132
32-     return  new  interpreter_type (argc, argv);
33+     auto * res = new  interpreter_type (argc, argv);
34+     argv_vec.clear ();
35+     args.clear ();
36+     return  res;
3337}
3438
3539EMSCRIPTEN_BINDINGS (my_module)
Original file line number Diff line number Diff line change 1818#include  " xinput.hpp" 
1919#include  " xinspect.hpp" 
2020#include  " xmagics/os.hpp" 
21+ #include  < iostream> 
2122#ifndef  EMSCRIPTEN
2223#include  " xmagics/xassist.hpp" 
2324#endif 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments