Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2689b5a3
Commit
2689b5a3
authored
Feb 07, 2007
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorer: Fix leak: always release the CFDictionary.
parent
d19a789f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
diskarb.c
programs/explorer/diskarb.c
+6
-4
No files found.
programs/explorer/diskarb.c
View file @
2689b5a3
...
...
@@ -53,10 +53,10 @@ static void appeared_callback( DADiskRef disk, void *context )
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
return
;
!
CFBooleanGetValue
(
ref
))
goto
done
;
/* get device name */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
return
;
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
goto
done
;
strcpy
(
device
,
"/dev/r"
);
CFStringGetCString
(
ref
,
device
+
6
,
sizeof
(
device
)
-
6
,
kCFStringEncodingASCII
);
...
...
@@ -75,6 +75,7 @@ static void appeared_callback( DADiskRef disk, void *context )
WINE_TRACE
(
"got mount notification for '%s' on '%s'
\n
"
,
device
,
mount_point
);
add_dos_device
(
device
,
device
,
mount_point
,
type
);
done:
CFRelease
(
dict
);
}
...
...
@@ -93,16 +94,17 @@ static void disappeared_callback( DADiskRef disk, void *context )
/* ignore non-removable devices */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaRemovable"
)
))
||
!
CFBooleanGetValue
(
ref
))
return
;
!
CFBooleanGetValue
(
ref
))
goto
done
;
/* get device name */
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
return
;
if
(
!
(
ref
=
CFDictionaryGetValue
(
dict
,
CFSTR
(
"DAMediaBSDName"
)
)))
goto
done
;
strcpy
(
device
,
"/dev/r"
);
CFStringGetCString
(
ref
,
device
+
6
,
sizeof
(
device
)
-
6
,
kCFStringEncodingASCII
);
WINE_TRACE
(
"got unmount notification for '%s'
\n
"
,
device
);
remove_dos_device
(
device
);
done:
CFRelease
(
dict
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment