diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs
index bd74d36c5684e8636ec953f0040775084ad92884..c77ca5c5e6ac4632493df0be2c2fb2d6d8183d85 100644
--- a/compiler/ghci/Linker.hs
+++ b/compiler/ghci/Linker.hs
@@ -1123,7 +1123,10 @@ unload_wkr hsc_env keep_linkables pls@PersistentLinkerState{..}  = do
         -- We don't do any cleanup when linking objects with the
         -- dynamic linker.  Doing so introduces extra complexity for
         -- not much benefit.
-      | otherwise
+
+      -- Code unloading currently disabled due to instability.
+      -- See #16841.
+      | False -- otherwise
       = mapM_ (unloadObj hsc_env) [f | DotO f <- linkableUnlinked lnk]
                 -- The components of a BCO linkable may contain
                 -- dot-o files.  Which is very confusing.
@@ -1131,6 +1134,7 @@ unload_wkr hsc_env keep_linkables pls@PersistentLinkerState{..}  = do
                 -- But the BCO parts can be unlinked just by
                 -- letting go of them (plus of course depopulating
                 -- the symbol table which is done in the main body)
+      | otherwise = return () -- see #16841
 
 {- **********************************************************************