mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 12:18:03 +02:00
LCL: fixed OpenURL if URL is invalid, bug #24958
git-svn-id: trunk@42640 -
This commit is contained in:
parent
00b45080ca
commit
eef666aa0d
@ -8,13 +8,11 @@ var
|
||||
begin
|
||||
if AURL = '' then
|
||||
Exit(False);
|
||||
cf := CFStringCreateWithCString(kCFAllocatorDefault, @AURL[1], kCFStringEncodingUTF8);
|
||||
if not Assigned(cf) then
|
||||
url := CFURLCreateWithBytes(nil, @AURL[1], Length(AURL), kCFStringEncodingUTF8, nil);
|
||||
if not Assigned(url) then
|
||||
Exit(False);
|
||||
url := CFURLCreateWithString(nil, cf, nil);
|
||||
Result := LSOpenCFURLRef(url, nil) = 0;
|
||||
CFRelease(url);
|
||||
CFRelease(cf);
|
||||
end;
|
||||
|
||||
// Open a document with the default application associated with it in the system
|
||||
|
Loading…
Reference in New Issue
Block a user