 */
 
 public class ThreadConfinementStack: CoreDataStack {
-    private var backgroundContextsNeedingRefresh = [NSManagedObjectContext]()
+    private var backgroundContextsNeedingRefresh = NSHashTable.weakObjectsHashTable()
 
     /**
     Primary managed object context for main queue work.

    }

    @objc private func mergeChangedFromMainQueueContextSaveNotification(notification: NSNotification) {
        for context in backgroundContextsNeedingRefresh {
            context.performBlockAndWait() {
                context.mergeChangesFromContextDidSaveNotification(notification)
            }
        }
    }


        // Optionally refresh this worker moc whenever the main MOC saves.
        if shouldReceiveUpdates {
            backgroundContextsNeedingRefresh.addObject(context)
        }

        return context
