thorsson_cups 0.1.3 → 0.1.4pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/ext/cups.c +3 -34
  2. metadata +4 -4
data/ext/cups.c CHANGED
@@ -152,25 +152,10 @@ static VALUE cups_print(VALUE self)
152
152
  int encryption = (http_encryption_t)cupsEncryption();
153
153
  http_t *http = httpConnectEncrypt (url, port, (http_encryption_t) encryption);
154
154
  job_id = cupsPrintFile2(http, target, fname, "rCups", num_options, options); // Do it. "rCups" should be the filename/path
155
-
156
- cupsFreeOptions(num_options, options);
155
+ //
156
+ // cupsFreeOptions(num_options, options);
157
157
 
158
158
  rb_iv_set(self, "@job_id", INT2NUM(job_id));
159
-
160
-
161
- // 25.03 free memory
162
- if(fname != NULL)
163
- free(fname);
164
-
165
- if(url != NULL)
166
- free(url);
167
-
168
- if(target != NULL)
169
- free(target);
170
-
171
- if(http != NULL)
172
- free(http);
173
-
174
159
  return Qtrue;
175
160
  }
176
161
 
@@ -325,13 +310,6 @@ static VALUE cups_get_job_state(VALUE self)
325
310
  cupsFreeJobs(num_jobs, jobs);
326
311
 
327
312
  jstate = ipp_state_to_symbol(job_state);
328
-
329
- if(jobs != NULL)
330
- free(jobs);
331
-
332
- if(printer_arg != NULL)
333
- free(printer_arg);
334
-
335
313
  return jstate;
336
314
  }
337
315
  }
@@ -369,12 +347,6 @@ static VALUE cups_job_completed(VALUE self)
369
347
  // Free job array
370
348
  cupsFreeJobs(num_jobs, jobs);
371
349
 
372
- if(jobs != NULL)
373
- free(jobs);
374
-
375
- if(printer_arg != NULL)
376
- free(printer_arg);
377
-
378
350
  if (job_state == IPP_JOB_COMPLETED) {
379
351
  return Qtrue;
380
352
  } else {
@@ -456,10 +428,7 @@ static VALUE cups_cancel_print(int argc, VALUE* argv, VALUE self)
456
428
  char *target = RSTRING_PTR(printer); // Target printer string
457
429
  int cancellation;
458
430
  cancellation = cupsCancelJob(target, job);
459
-
460
- if(target != NULL)
461
- free(target);
462
-
431
+
463
432
  return Qtrue;
464
433
  }
465
434
  }
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thorsson_cups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.1.4pre
5
+ prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ivan Turkovic
@@ -50,9 +50,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
- - - ! '>='
53
+ - - ! '>'
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 1.3.1
56
56
  requirements: []
57
57
  rubyforge_project: thorsson_cups
58
58
  rubygems_version: 1.5.2