--- old/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java 2014-05-12 16:56:02.000000000 -0400 +++ new/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java 2014-05-12 16:56:01.000000000 -0400 @@ -552,6 +552,27 @@ stylesheetRemoved(parent, fname); } } + + Iterator containerIterator = stylesheetContainerMap.values().iterator(); + while (containerIterator.hasNext()) { + StylesheetContainer container = containerIterator.next(); + container.parentUsers.remove(parent); + if (container.parentUsers.list.isEmpty()) { + + containerIterator.remove(); + + if (container.selectorPartitioning != null) { + container.selectorPartitioning.reset(); + } + + + // clean up image cache by removing images from the cache that + // might have come from this stylesheet + final String fname = container.fname; + cleanUpImageCache(fname); + } + } + // Do not iterate over children since this method will be called on each from Parent#scenesChanged }