diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
index 4080d2a3d2de6..861bf21962d75 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
@@ -111,6 +111,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->comment(sprintf('Clearing the cache for the %s environment with debug %s', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
$this->cacheClearer->clear($realCacheDir);
+ // The current event dispatcher is stale, let's not use it anymore
+ $this->getApplication()->setDispatcher(new EventDispatcher());
+
if ($input->getOption('no-warmup')) {
$this->filesystem->rename($realCacheDir, $oldCacheDir);
} else {
@@ -129,9 +132,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->filesystem->remove($oldCacheDir);
- // The current event dispatcher is stale, let's not use it anymore
- $this->getApplication()->setDispatcher(new EventDispatcher());
-
if ($output->isVerbose()) {
$io->comment('Finished');
}