Skip to content

Commit

Permalink
Fixed assert to protect against non-singleton behaviour, Removed unne…
Browse files Browse the repository at this point in the history
…cessary dispatch_release
  • Loading branch information
FahimF committed Jul 11, 2014
1 parent de53ef6 commit 4e0c77b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions SQLiteDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class SQLiteDB {

@required init() {
println("SQLiteDB - Init method")
// assert(Static.instance == nil, "Singleton already initialized!")
assert(!Static.instance, "Singleton already initialized!")
// Set queue
queue = dispatch_queue_create(QUEUE_LABLE, nil)
// Get path to DB in Documents directory
Expand Down Expand Up @@ -159,7 +159,6 @@ class SQLiteDB {

deinit {
closeDatabase()
dispatch_release(queue)
}

func closeDatabase() {
Expand Down Expand Up @@ -437,4 +436,4 @@ class SQLiteDB {
// println("SQLiteDB - Got value: \(val)")
return val
}
}
}

0 comments on commit 4e0c77b

Please sign in to comment.