Spelt / ZXing.Delphi

ZXing Barcode Scanning object Pascal Library for Delphi VCL and Delphi Firemonkey
Apache License 2.0
473 stars 206 forks source link

Couple of bugs from compiler warnings #48

Closed nano103 closed 7 years ago

nano103 commented 7 years ago

memory leak with TStringBuilder fixed "else" added to fix logic (as in ZXing.Net) method name case fixed to prevent warning

Spelt commented 7 years ago

Thanks!

Question: why the breaks? in C# a break is used also to get out the switch (Case in Pascal) statement.

Seems like it did not leak but in any case I added a try finally to the code. This is the recommended way to guard resources.

The 'Else' I added.

In Pascal functions/procedures casing should be started with a upper case. In this case we follow Pascal.

I pushed a new commit to reflect the changes.

nano103 commented 7 years ago

in c# source it was return ‘’ in our code break means break from while cycle and go to the set result and string builder free. instead of break we can put

Decoded.Free; exit(‘’);

“Case” warning in delphi 10.1 was “inherited function and overridden case mismatch” or something like that. so I make them equal.

From: E Spelt Sent: Sunday, December 11, 2016 12:53 PM To: Spelt/ZXing.Delphi Cc: nano103 ; Author Subject: Re: [Spelt/ZXing.Delphi] Couple of bugs from compiler warnings (#48)

Thanks!

Question: why the breaks? in C# a break is used also to get out the switch (Case in Pascal) statement.

Seems like it did not leak but in any case I added a try finally to the code. This is the recommended way to guard resources.

The 'Else' I added.

In Pascal functions/procedures casing should be started with a upper case. In this case we follow Pascal.

I pushed a new commit to reflect the changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Spelt commented 7 years ago

Ok thanks.

2016-12-11 11:23 GMT+01:00 nano103 notifications@github.com:

in c# source it was return ‘’ in our code break means break from while cycle and go to the set result and string builder free. instead of break we can put

Decoded.Free; exit(‘’);

“Case” warning in delphi 10.1 was “inherited function and overridden case mismatch” or something like that. so I make them equal.

From: E Spelt Sent: Sunday, December 11, 2016 12:53 PM To: Spelt/ZXing.Delphi Cc: nano103 ; Author Subject: Re: [Spelt/ZXing.Delphi] Couple of bugs from compiler warnings (#48)

Thanks!

Question: why the breaks? in C# a break is used also to get out the switch (Case in Pascal) statement.

Seems like it did not leak but in any case I added a try finally to the code. This is the recommended way to guard resources.

The 'Else' I added.

In Pascal functions/procedures casing should be started with a upper case. In this case we follow Pascal.

I pushed a new commit to reflect the changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/pull/48#issuecomment-266274111, or mute the thread https://github.com/notifications/unsubscribe-auth/AMEt1QzHf2aQ7awvGBc7oSaKDGfyVNIkks5rG88KgaJpZM4LJv5R .