Skip to content

Commit 17be1dc

Browse files
committed
Fixes severe memory leaks
1 parent ce8ee60 commit 17be1dc

File tree

16 files changed

+402
-112
lines changed

16 files changed

+402
-112
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ CSS-Sass-*.tar.gz
1919
lib/**/*.o
2020
lib/**/*.c
2121
lib/**/*.xs
22+
lib/**/*.pod
23+
lib/**/*/*.pod
2224
*~

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "libsass"]
22
path = libsass
3-
url = git://github.com/sass/libsass.git
3+
url = git://github.com/mgreter/libsass.git
44
[submodule "t/sass-spec"]
55
path = t/sass-spec
66
url = git://github.com/sass/sass-spec.git

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ perl:
1111

1212
before_install:
1313
- git submodule update --init --recursive
14-
- cpanm File::Slurp
15-
- cpanm Devel::Cover
16-
- cpanm -n Devel::Cover::Report::Coveralls
1714
install:
18-
# Deal with all of the dependencies, quickly and quietly
19-
- cpanm --quiet --notest --skip-satisfied Class::Accessor::Fast
15+
# Deal with dependencies
16+
- cpanm -n File::Slurp
17+
- cpanm -n Devel::Cover
18+
- cpanm -n Devel::Cover::Report::Coveralls
2019
before_script:
2120
# initialize libsass, sass2scss and sass-spec
2221
# - git submodule update --init --recursive

Build.PL

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if (-d ".git") {
1212
my @modules = ('.');
1313
my $base = getcwd;
1414
my ($dir, $manifest);
15+
system "git submodule init";
16+
system "git submodule update";
1517
open $manifest, ">", "MANIFEST" or die "MANIFEST: $!";
1618
print $manifest "MANIFEST\n";
1719
while (my $module = shift @modules)
@@ -83,17 +85,17 @@ my %config = (
8385
dist_author => [q{David Caldwell <[email protected]>},
8486
q{Marcel Greter <[email protected]>}],
8587
dist_version_from => 'lib/CSS/Sass.pm',
86-
release_status => 'stable',
87-
create_license => 1,
88+
release_status => 'unstable',
89+
create_license => 0,
8890
configure_requires => {
8991
'Module::Build' => 0,
9092
},
9193
build_requires => {
9294
'Test::More' => 0,
9395
},
9496
requires => {
97+
'perl' => '5.008',
9598
'File::Slurp' => 0,
96-
'Class::Accessor::Fast' => 0,
9799
},
98100
meta_merge => {
99101
resources => {
@@ -116,7 +118,7 @@ my %config = (
116118
extend.cpp file.cpp functions.cpp inspect.cpp output_compressed.cpp
117119
output_nested.cpp parser.cpp prelexer.cpp sass.cpp sass_interface.cpp
118120
source_map.cpp to_c.cpp to_string.cpp units.cpp utf8_string.cpp util.cpp
119-
) ] #, "sass2scss" => [ qw(sass2scss.cpp) ]
121+
) ]
120122
},
121123
config => { ld => 'c++' }, # Need to link with a C++ linker since libsass is C++ (even though the .xs file is not)
122124
);

Changes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
CSS::Sass (3.0.1)
2+
3+
* Adds latest libsass changes (3.0.0)
4+
* Reimplemented and improved CSS::Sass::Type
5+
* Fixes memory leaks introduced in 3.0.0
6+
* Fixes building on various platforms
7+
8+
-- Marcel Greter <[email protected]> Sat Oct 25 14:04:37 2014 +0200
9+
10+
CSS::Sass (3.0.0)
11+
12+
* Updates to latest libsass (3.0.0)
13+
* Implements libsass source maps options
14+
* Exports libsass sass2scss function
15+
* Adds minimal command line utility
16+
* Adds complete sass-spec test suite
17+
* Adds CSS::Sass::Type::Map for maps
18+
* Adds Travis CI (continous integration)
19+
* Adds coveralls.io (code coverage metrics)
20+
21+
-- Marcel Greter <[email protected]> Sat Oct 25 14:00:47 2014 +0200
22+
123
CSS::Sass (0.8.1)
224

325
* Add requirement for Class::Accessor::Fast to Build.PL. One day it will

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Installation
1414

1515
[![Build Status](https://travis-ci.org/sass/perl-libsass.svg?branch=master)](https://travis-ci.org/sass/perl-libsass)
1616
[![Coverage Status](https://img.shields.io/coveralls/sass/perl-libsass.svg)](https://coveralls.io/r/sass/perl-libsass?branch=master)
17+
[![CPAN version](https://badge.fury.io/pl/CSS-Sass.svg)](http://badge.fury.io/pl/CSS-Sass)
1718

1819
To install this module type the following:
1920

lib/CSS/Sass.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NAME
1+
# NAME - perl bindings for libsass
22

33
CSS::Sass - Compile .scss files using libsass
44

@@ -178,6 +178,7 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
178178
are [CSS::Sass::Type](https://metacpan.org/pod/CSS::Sass::Type) objects, which map to native perl types if possible.
179179
You can return either [CSS::Sass::Type](https://metacpan.org/pod/CSS::Sass::Type) objects or supported native perl data
180180
structures. `undef` is an equivalent of CSS::Sass::Type::Null->new.
181+
181182
The function is called with an `eval` statement so you may use "die" to
182183
throw errors back to libsass (`CSS::Sass::Type::Error`).
183184

@@ -296,11 +297,24 @@ feature parity and heading towards 3.4. It can compile .scss and .sass files.
296297
David Caldwell <[email protected]>
297298
Marcel Greter <[email protected]>
298299

299-
# COPYRIGHT AND LICENSE
300+
# LICENSE
301+
302+
The MIT License (MIT)
303+
304+
Permission is hereby granted, free of charge, to any person obtaining a copy
305+
of this software and associated documentation files (the "Software"), to deal
306+
in the Software without restriction, including without limitation the rights
307+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
308+
copies of the Software, and to permit persons to whom the Software is
309+
furnished to do so, subject to the following conditions:
300310

301-
Copyright (C) 2013 by David Caldwell
302-
Copyright (C) 2014 by Marcel Greter
311+
The above copyright notice and this permission notice shall be included in
312+
all copies or substantial portions of the Software.
303313

304-
This library is free software; you can redistribute it and/or modify
305-
it under the same terms as Perl itself, either Perl version 5.12.4 or,
306-
at your option, any later version of Perl 5 you may have available.
314+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
315+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
316+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
317+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
318+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
319+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
320+
THE SOFTWARE.

lib/CSS/Sass.pm

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ our @EXPORT = qw(
4646
SASS2SCSS_CONVERT_COMMENT
4747
);
4848

49-
our $VERSION = "v3.0.0";
49+
our $VERSION = "v3.0.1";
5050

5151
require XSLoader;
5252
XSLoader::load('CSS::Sass', $VERSION);
@@ -150,7 +150,7 @@ sub sass_function_callback {
150150
1;
151151
__END__
152152
153-
=head1 NAME
153+
=head1 NAME - perl bindings for libsass
154154
155155
CSS::Sass - Compile .scss files using libsass
156156
@@ -409,8 +409,6 @@ We bless native return values from custom functions into the correct package.
409409
# sub get-list { return [ 'foo', 42, 'bar' ] };
410410
.class { content: nth(get-list(), 2); }
411411
412-
413-
414412
=back
415413
416414
=head1 MISCELLANEOUS
@@ -473,13 +471,26 @@ L<The CSS::Sass Home Page|https://github.com/sass/perl-libsass>
473471
David Caldwell E<lt>[email protected]E<gt>
474472
Marcel Greter E<lt>[email protected]E<gt>
475473
476-
=head1 COPYRIGHT AND LICENSE
474+
=head1 LICENSE
475+
476+
The MIT License (MIT)
477+
478+
Permission is hereby granted, free of charge, to any person obtaining a copy
479+
of this software and associated documentation files (the "Software"), to deal
480+
in the Software without restriction, including without limitation the rights
481+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
482+
copies of the Software, and to permit persons to whom the Software is
483+
furnished to do so, subject to the following conditions:
477484
478-
Copyright (C) 2013 by David Caldwell
479-
Copyright (C) 2014 by Marcel Greter
485+
The above copyright notice and this permission notice shall be included in
486+
all copies or substantial portions of the Software.
480487
481-
This library is free software; you can redistribute it and/or modify
482-
it under the same terms as Perl itself, either Perl version 5.12.4 or,
483-
at your option, any later version of Perl 5 you may have available.
488+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
489+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
490+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
491+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
492+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
493+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
494+
THE SOFTWARE.
484495
485496
=cut

0 commit comments

Comments
 (0)