(*i)->signal_path_changed.connect(sigc::hide(sigc::bind(sigc::mem_fun(this, &BlockAllocator::turnout_path_changed), sigc::ref(**i))));
}
-void BlockAllocator::start_from(Block &block, unsigned entry)
+void BlockAllocator::start_from(const BlockIter &block)
{
+ if(!block)
+ throw invalid_argument("BlockAllocator::start_from");
+
release_blocks(blocks.begin(), blocks.end());
- blocks.push_back(BlockIter(&block, entry));
- if(!block.reserve(&train))
+ blocks.push_back(block);
+ if(!block->reserve(&train))
{
blocks.pop_back();
return;