Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I have to bother about closing Realm database in Objective-C and Swift?

Java documentation for Realm class has method close. It is written in method details: "It's important to always remember to close Realm instances when you're done with it in order not to leak memory, file descriptors or grow the size of Realm file out of measure."

Neither Objective-C documentation for RLMRealm class nor Swift documentation for Realm class show anything similar.

Do I have to bother about closing Realm database in Objective-C and Swift? Why are these differences between platforms?

like image 369
Valeriy Van Avatar asked Aug 25 '15 10:08

Valeriy Van


1 Answers

No you don't have to bother about closing the database.

If Realm doesn't provide a close method, the closing is handled by Realm itself. As you already mentioned, there are differences between different platforms/operation systems.

like image 117
Christian Avatar answered Nov 15 '22 15:11

Christian