WindowModule should unload when no window exists during run

This commit is contained in:
2025-05-02 12:18:16 -05:00
parent 73ce460446
commit 047684c51b
4 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,6 @@ namespace Archimedes {
} }
if(!handled) { if(!handled) {
std::cout << "here?\n";
if(this->onEvent(*events.front())) { if(this->onEvent(*events.front())) {
Event* e = events.front(); Event* e = events.front();
events.pop_front(); events.pop_front();

View File

@@ -125,7 +125,7 @@ bool ClientModule::onEvent(const Archimedes::Event& event) {
void ClientModule::pollIncomingData() { void ClientModule::pollIncomingData() {
while(running) { while(running && connection != k_HSteamNetConnection_Invalid) {
ISteamNetworkingMessage *pIncomingMsg = nullptr; ISteamNetworkingMessage *pIncomingMsg = nullptr;
int numMsgs = interface->ReceiveMessagesOnConnection( connection, &pIncomingMsg, 1 ); int numMsgs = interface->ReceiveMessagesOnConnection( connection, &pIncomingMsg, 1 );
if ( numMsgs == 0 ) if ( numMsgs == 0 )

View File

@@ -45,6 +45,8 @@ void WindowModule::run() {
if(window) if(window)
window->doFrame(); window->doFrame();
else
app->emitEvent(new Archimedes::DoUnloadModuleEvent(name));
} }
bool WindowModule::onEvent(const Archimedes::Event& e) { bool WindowModule::onEvent(const Archimedes::Event& e) {

View File

@@ -3,7 +3,6 @@
void MinimalApp::run() { void MinimalApp::run() {
for(std::string m : runOrder) { for(std::string m : runOrder) {
std::cout << "onLoad: " << m << std::endl;
modules[m]->onLoad(); modules[m]->onLoad();
} }