Skip to content

Instantly share code, notes, and snippets.

@arohner
Created August 1, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arohner/bea02dd56c5212f6ba7a to your computer and use it in GitHub Desktop.
Save arohner/bea02dd56c5212f6ba7a to your computer and use it in GitHub Desktop.
class MemoryLeaker
{
func leakOne()
{
// let event = EventKeyboard.MR_createEntity() as EventKeyboard!
let context = NSManagedObjectContext.MR_contextForCurrentThread()
let entityname = NSStringFromClass(EventKeyboard)
let event = NSEntityDescription.insertNewObjectForEntityForName(entityname, inManagedObjectContext:context) as EventKeyboard
event.MR_deleteEntity();
}
func leakAll()
{
while true
{
leakOne()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment