jet-live: macOS crash

I just stepped a bit jet live and now I gott an error on reload:

Capture d’écran 2019-12-05 à 12 28 58

There is the following code:

#include <imgui.h>
#include <antara/gaming/graphics/component.canvas.hpp>
#include <antara/gaming/event/quit.game.hpp>
#include <antara/gaming/event/key.pressed.hpp>
#include "atomic.dex.gui.hpp"

namespace {
    void gui_menubar() noexcept {
        if (ImGui::BeginMenuBar()) {
            if (ImGui::MenuItem("Open", "Ctrl+O")) { /* Do stuff */ }
            ImGui::EndMenuBar();
        }
    }
}

namespace atomic_dex {
    void gui::on_key_pressed(const ag::event::key_pressed &evt) noexcept {
        if (evt.key == ag::input::r && evt.control) {
#if defined(__APPLE__) || defined(__linux__)
            live_.tryReload();
#endif
        }
    }

    gui::gui(entt::registry &registry) noexcept : system(registry) {
#if defined(__APPLE__) || defined(__linux__)
        while (!live_.isInitialized()) {
            std::this_thread::sleep_for(std::chrono::milliseconds(100));
            live_.update();
        }
        live_.update();
#endif
        this->dispatcher_.sink<ag::event::key_pressed>().connect<&gui::on_key_pressed>(*this);
    }

    void gui::update() noexcept {
#if defined(__APPLE__) || defined(__linux__)
        live_.update();
#endif
        //! Menu bar
        auto &canvas = entity_registry_.ctx<ag::graphics::canvas_2d>();
        auto[x, y] = canvas.canvas.size;
        auto[pos_x, pos_y] = canvas.canvas.position;

        ImGui::SetNextWindowSize(ImVec2(x, y));
        ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y));
        ImGui::SetNextWindowFocus();
        bool active = true;
        ImGui::Begin("Atomic Dex", &active, ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse);
        if (not active) { this->dispatcher_.trigger<ag::event::quit_game>(0); }
        gui_menubar();
        ImGui::End();
    }
}

(I modify the function in the anonymous namespace and I reload)

(instant crash)

(Apple Clang 11.0) (clang-8)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 29 (12 by maintainers)

Most upvoted comments

Ok thank’s @ddovod

I will try to solve the problem don’t worry, I don’t want to waste your time.

I’m adding some important dependancies to the project that I’m developing so you will not be able to compile easily like before.

I’m closing it for the moment, and I will try to use jet-live on Linux if needed.

For osx I think it’s a good idea to integrate into the CI too so we can have a better view on it !

Thank’s a lot !

ok great! thank’s a lot for your help and patience @ddovod !