File tree Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Expand file tree Collapse file tree 2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,6 @@ import 'package:ffi/ffi.dart';
77import 'package:files/backend/fs_native.dart' ;
88import 'package:flutter/foundation.dart' ;
99
10- // !copy: progress, cancellable, error (source, dest)
11- // !create: cancellable, error (source)
12- // !delete: cancellable, error (source)
13- // !enumerate: cancellable, error (source)
14- // make_directory: cancellable, error (source)
15- // !move: progress, cancellable, error (source, dest)
16- // !query_info: cancellable, error (source)
17- // !trash: cancellable, error (source)
18-
1910void initFileSystemThread () {
2011 // TODO: handle pointer management
2112 init_io_thread ();
Original file line number Diff line number Diff line change 1- const _file = @import ("file" );
2- const _file_enum = @import ("file_enum" );
3- const _misc = @import ("misc" );
4-
51const std = @import ("std" );
62const c = @cImport ({
73 @cInclude ("glib.h" );
@@ -393,23 +389,29 @@ pub export fn fileinfo_get_file_type(info: *c.GFileInfo) c_uint {
393389pub export fn fileinfo_get_creation_time (info : * c.GFileInfo ) ? [* ]const u8 {
394390 const time = c .g_file_info_get_creation_date_time (info );
395391 if (time ) | _time | {
396- return c .g_date_time_format_iso8601 (_time );
392+ const iso_str = c .g_date_time_format_iso8601 (_time );
393+ c .g_date_time_unref (time );
394+ return iso_str ;
397395 }
398396 return null ;
399397}
400398
401399pub export fn fileinfo_get_access_time (info : * c.GFileInfo ) ? [* ]const u8 {
402400 const time = c .g_file_info_get_access_date_time (info );
403401 if (time ) | _time | {
404- return c .g_date_time_format_iso8601 (_time );
402+ const iso_str = c .g_date_time_format_iso8601 (_time );
403+ c .g_date_time_unref (time );
404+ return iso_str ;
405405 }
406406 return null ;
407407}
408408
409409pub export fn fileinfo_get_modification_time (info : * c.GFileInfo ) ? [* ]const u8 {
410410 const time = c .g_file_info_get_modification_date_time (info );
411411 if (time ) | _time | {
412- return c .g_date_time_format_iso8601 (_time );
412+ const iso_str = c .g_date_time_format_iso8601 (_time );
413+ c .g_date_time_unref (time );
414+ return iso_str ;
413415 }
414416 return null ;
415417}
You can’t perform that action at this time.
0 commit comments