Skip to content

Commit e70b5a6

Browse files
nhojbwjakob
authored andcommitted
Removing use of -retain (incompatible with ARC). (#243)
1 parent 275aa69 commit e70b5a6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ if (APPLE OR CMAKE_SYSTEM MATCHES "Linux")
290290
endif()
291291

292292
add_definitions(${NANOGUI_EXTRA_DEFS})
293+
if (APPLE)
294+
add_definitions(-fobjc-arc)
295+
endif()
293296

294297
# Compile main NanoGUI library
295298
add_library(nanogui-obj OBJECT

src/darwin.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
std::string file_dialog(const std::vector<std::pair<std::string, std::string>> &filetypes, bool save) {
77
std::string path = "";
88
if (save) {
9-
NSSavePanel *saveDlg = [[NSSavePanel savePanel] retain];
9+
NSSavePanel *saveDlg = [NSSavePanel savePanel];
1010

1111
NSMutableArray *types = [NSMutableArray new];
1212
for (size_t idx = 0; idx < filetypes.size(); ++idx)
@@ -17,7 +17,7 @@
1717
if ([saveDlg runModal] == NSModalResponseOK)
1818
path = [[[saveDlg URL] path] UTF8String];
1919
} else {
20-
NSOpenPanel *openDlg = [[NSOpenPanel openPanel] retain];
20+
NSOpenPanel *openDlg = [NSOpenPanel openPanel];
2121

2222
[openDlg setCanChooseFiles:YES];
2323
[openDlg setCanChooseDirectories:NO];

0 commit comments

Comments
 (0)