Fixed the most common crash on exit, still one more hiding and crashing in libc

This commit is contained in:
2018-02-17 14:54:43 -08:00
parent d6bdcbdeca
commit c17d937ee5
13 changed files with 37 additions and 13 deletions

View File

@@ -18,6 +18,11 @@ Application::Application() {
Application::~Application() {
if (window.unique())
window.reset();
else {
Logger::log("Can't release window, shared_ptr coun : " + window.use_count(), Logger::LogLevel::WARN);
}
//light_handle->~LightHandle();
//light_controller->~LightController();
}

View File

@@ -370,7 +370,7 @@ void CLCaster::update_gui() {
}
void CLCaster::recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event) {
void CLCaster::event_handler(VrEventPublisher *publisher, std::unique_ptr<vr::Event> event) {
if (event->type == vr::Event::KeyPressed) {

View File

@@ -94,7 +94,7 @@ int Camera::update(double delta_time) {
return 1;
}
void Camera::recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event) {
void Camera::event_handler(VrEventPublisher *publisher, std::unique_ptr<vr::Event> event) {
if (event->type == vr::Event::KeyHeld) {

View File

@@ -36,7 +36,7 @@ void LightController::remove_light(unsigned int light_index) {
}
void LightController::recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event) {
void LightController::event_handler(VrEventPublisher *publisher, std::unique_ptr<vr::Event> event) {
if (event->type == vr::Event::KeyHeld) {}
else if (event->type == vr::Event::KeyPressed) {}

View File

@@ -68,7 +68,7 @@ void LightHandle::set_rgbi(sf::Vector4f rgbi)
data_reference->rgbi = rgbi;
}
void LightHandle::recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event)
void LightHandle::event_handler(VrEventPublisher *publisher, std::unique_ptr<vr::Event> event)
{
if (event->type == vr::Event::JoystickMoved) {

View File

@@ -74,10 +74,10 @@ void VrEventPublisher::notify_subscribers(std::unique_ptr<vr::Event> event) {
//std::vector<VrEventSubscriber*> *event_type_bucket = &subscribers[event->type];
// Send them the event
// Each and every event that is received in the recieve_event function
// Each and every event that is received in the event_handler function
// will be a unique ptr solely owned by that function
for (auto s : subscribers[event->type]) {
s->recieve_event(this, event->clone());
s->event_handler(this, event->clone());
}
}