Skip to content

Commit

Permalink
Login close fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
peleccom committed Oct 8, 2013
1 parent bc01c49 commit ab9cd7b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions TCBox.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var
LogFullFilename: string;
AccessKeyFullFileName: string;
LocalEncoding: TEncoding;
LoginClosed: boolean;

// SSL libs
libeay32Handle, ssleay32Handle: THandle;
Expand Down Expand Up @@ -162,7 +163,9 @@ begin
DropboxSession := TDropboxSession.Create(APP_KEY, APP_SECRET,
TAccessType.dropbox);
DropboxClient := TDropboxClient.Create(DropboxSession);
ShowDllFormModal();
LoginClosed := not ShowDllFormModal();
if LoginClosed then
DropboxSession.unlink();
Result := 0;
end;

Expand All @@ -184,15 +187,16 @@ var
FindDatatmp: tWIN32FINDDATAW;
PFindNextRec: ^TFindNextRecord;
begin
if not DropboxSession.isLinked() then
if (not DropboxSession.isLinked()) and (not LoginClosed) then
begin
if not ShowDllFormModal() then
begin
DropboxSession.unlink();
Result := INVALID_HANDLE_VALUE;
exit;
end;

end;
LoginClosed := False;
Result := INVALID_HANDLE_VALUE;
New(PFindNextRec);
New(PFindNextRec.PList);
Expand Down

0 comments on commit ab9cd7b

Please sign in to comment.