Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-04

For issue #31638 (gtk2 function that require free mem)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey
+      if Assigned(Path) then
+      begin
+        AStr := gtk_tree_path_to_string(path);
+        AIsSet := (StrToInt(AStr) = AIndex);
+        if AStr  nil then
+          g_free(AStr);
+        if Path  nil then
+          gtk_tree_path_free(Path);
+        Result := True;
+      end;

1- not need in last check "if Pathnil", checked before 2- better StrToIntDef(AStr, -1) to not give exception (cannot comment there.)

Alexey

Reply by email

Mattias Gaertner
to Alexey
Show quoted text 14 lines
+ if Assigned(Path) then + begin + AStr := gtk_tree_path_to_string(path); + AIsSet := (StrToInt(AStr) = AIndex); + if AStr nil then + g_free(AStr); + if Path nil then + gtk_tree_path_free(Path); + Result := True; + end; 1- not need in last check "if Pathnil", checked before 2- better StrToIntDef(AStr, -1) to not give exception (cannot comment there.)

Done. Thanks for the hint.

Mattias

Reply by email