Commit a3f66385 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - fixed some issues with project loader

parent f5a98b3d
......@@ -24,9 +24,6 @@
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include "common/WSegmentationFault.h"
#include "common/WLogger.h"
......
......@@ -184,7 +184,7 @@ void WKernel::threadMain()
}
// TODO(ebaum): remove!
WModuleProjectFileCombiner mc = WModuleProjectFileCombiner( "/home/ebaum/test.prj" );
WModuleProjectFileCombiner mc = WModuleProjectFileCombiner( "/home/seth/test.prj" );
mc.apply();
// actually there is nothing more to do here
......
......@@ -357,10 +357,14 @@ void WModule::threadMain()
}
catch( const WException& e )
{
WLogger::getLogger()->addLogMessage( "WException. Notifying.", "Module (" + getName() + ")", LL_ERROR );
wlog::error( "Module (" + getName() +")" ) << "WException. Notifying. Message: " << e.what();
// ensure proper exception propagation
signal_error( shared_from_this(), e );
// module needs to be marked as ready or waiting threads (container, kernel) might wait for ever if the exception was thrown before
// ready().
ready();
}
catch( const std::exception& e )
{
......@@ -369,6 +373,10 @@ void WModule::threadMain()
// convert these exceptions to WException
WException ce = WException( e );
signal_error( shared_from_this(), ce );
// module needs to be marked as ready or waiting threads (container, kernel) might wait for ever if the exception was thrown before
// ready().
ready();
}
}
......
......@@ -188,6 +188,13 @@ void WModuleProjectFileCombiner::apply()
m_container->add( ( *iter ).second );
}
// now wait for the modules to get ready. We could have waited for this in the previous loop, but a long loading module would block others.
// -> so we wait after adding and starting them
for ( std::map< unsigned int, boost::shared_ptr< WModule > >::const_iterator iter = modules.begin(); iter != modules.end(); ++iter )
{
( *iter ).second->isReady().wait();
}
// and finally, connect them all together
for ( std::list< Connection >::const_iterator iter = connections.begin(); iter != connections.end(); ++iter )
{
......@@ -253,5 +260,10 @@ void WModuleProjectFileCombiner::apply()
continue;
}
}
// clear all our lists (deref all contained pointers)
modules.clear();
connections.clear();
properties.clear();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment