| 114 | } |
| 115 | |
| 116 | void Plugin::Unload() |
| 117 | { |
| 118 | if (!_context) |
| 119 | { |
| 120 | throw std::runtime_error("Plugin is not loaded"); |
| 121 | } |
| 122 | |
| 123 | JS_FreeContext(_context); |
| 124 | _context = nullptr; |
| 125 | |
| 126 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937, fixed in GCC13 |
| 127 | #if defined(__GNUC__) && !defined(__clang__) |
| 128 | #pragma GCC diagnostic push |
| 129 | #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" |
| 130 | #endif |
| 131 | _metadata.Main = {}; |
| 132 | #if defined(__GNUC__) && !defined(__clang__) |
| 133 | #pragma GCC diagnostic pop |
| 134 | #endif |
| 135 | _hasLoaded = false; |
| 136 | } |
| 137 | |
| 138 | void Plugin::LoadCodeFromFile() |
| 139 | { |
no outgoing calls
no test coverage detected