WindowModule should unload when no window exists during run
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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 )
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user